# FactoryIO 2.5.2 WebAPI + OpenPLC driver

**URL:** <https://community.factoryio.com/t/factoryio-2-5-2-webapi-openplc-driver/1739>\
**Category:** Support\
**Created:** [October 30, 2022, 7:01pm UTC](https://community.factoryio.com/t/factoryio-2-5-2-webapi-openplc-driver/1739 "2022-10-30T19:01:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![tosqui17](https://avatars.discourse-cdn.com/v4/letter/t/3be4f8/32.png) [@tosqui17](https://community.factoryio.com/u/tosqui17)\
**Post date:** [October 30, 2022, 7:01pm UTC](https://community.factoryio.com/t/factoryio-2-5-2-webapi-openplc-driver/1739/1 "2022-10-30T19:01:26Z")

</div>

Hi all,

I need to use Factory I/O WebAPI in my cybersecurity project, as I would like to automate it by not touching the Factory I/O GUI (if it is possible).

Basically, I have tried and the api only allows me to write values for coils, but I cannot write values for inputs.

## i.e.

REQUEST  
curl -X PUT -d ‘[{“name”: “Start Button 0”, “value”: true}]’ -H “Content-Type: application/json; charset=utf-8” [http://127.0.0.1:7410/api/tag/values/by-name](http://127.0.0.1:7410/api/tag/values/by-name)

RESPONSE

[{“name”: “Start Button 0”, “code”: 406, “error”: “You are not allowed to set the value of an input tag.”}]

* * *

REQUEST  
curl -X PUT -d ‘[{“name”: “Start Button 0 (Light)”, “value”: 1}]’ -H “Content-Type: application/json; charset=utf-8” [http://127.0.0.1:7410/api/tag/values/by-name](http://127.0.0.1:7410/api/tag/values/by-name)

I’m not at pc and don’t remember the answer, but I’m sure the start button light comes on without error.

I think it may be a communication problem between webapi and openplc, but I am not sure and I am looking for someone who has encountered the same problem or something similar.

---

<div class="post-metadata">

**Author:** ![brunovgr](https://dub1.discourse-cdn.com/flex017/user_avatar/community.factoryio.com/brunovgr/32/12_2.png) [@brunovgr](https://community.factoryio.com/u/brunovgr)\
**Post date:** [November 3, 2022, 9:48am UTC](https://community.factoryio.com/t/factoryio-2-5-2-webapi-openplc-driver/1739/2 "2022-11-03T09:48:15Z")

</div>

Hi,

You cannot write values to sensors but you can force sensors using the `PUT` verb and the endpoint `api/tag/values-force`.

---

<div class="post-metadata">

**Author:** ![tosqui17](https://avatars.discourse-cdn.com/v4/letter/t/3be4f8/32.png) [@tosqui17](https://community.factoryio.com/u/tosqui17)\
**Post date:** [November 5, 2022, 1:20pm UTC](https://community.factoryio.com/t/factoryio-2-5-2-webapi-openplc-driver/1739/5 "2022-11-05T13:20:47Z")

</div>

I found a way to avoid hitting the run key by adding ‘scene.start\_in\_run\_mode = True.’ and set scene with ‘scene.load\_from\_path(“c:\…” )’  
no way to stream the scene so far…

---

<div class="post-metadata">

**Author:** ![brunovgr](https://dub1.discourse-cdn.com/flex017/user_avatar/community.factoryio.com/brunovgr/32/12_2.png) [@brunovgr](https://community.factoryio.com/u/brunovgr)\
**Post date:** [November 7, 2022, 9:35am UTC](https://community.factoryio.com/t/factoryio-2-5-2-webapi-openplc-driver/1739/6 "2022-11-07T09:35:09Z")

</div>

Hi,

What do you mean by streaming the scene? If you are trying to toggle between Edit/Run modes, you can use the Factory I/O (Run) actuator tag.

---

<div class="post-metadata">

**Author:** ![tosqui17](https://avatars.discourse-cdn.com/v4/letter/t/3be4f8/32.png) [@tosqui17](https://community.factoryio.com/u/tosqui17)\
**Post date:** [November 7, 2022, 9:54am UTC](https://community.factoryio.com/t/factoryio-2-5-2-webapi-openplc-driver/1739/7 "2022-11-07T09:54:53Z")

</div>

The 'goal is to create a kind of dashboard where the current scene is shown among other things. The various tags and configurations in auto.cfg allow me to directly start a scene, even if the window is not focused, but I can’t extract the scene and do for example streaming to a web page. If is not possible and i may say, consider to integrate this feature in the nexts software updates.

---

<div class="post-metadata">

**Author:** ![brunovgr](https://dub1.discourse-cdn.com/flex017/user_avatar/community.factoryio.com/brunovgr/32/12_2.png) [@brunovgr](https://community.factoryio.com/u/brunovgr)\
**Post date:** [November 7, 2022, 10:55am UTC](https://community.factoryio.com/t/factoryio-2-5-2-webapi-openplc-driver/1739/8 "2022-11-07T10:55:46Z")

</div>

I understand now, thanks for the feedback.
