ioBroker / ioBroker.hass

Connects Home Assistant to ioBroker
https://www.home-assistant.io/
MIT License
24 stars 15 forks source link

BUG: set number value not possible #55

Closed Bark33p3r closed 2 years ago

Bark33p3r commented 2 years ago

It's not possible to set a number value. When I enter a number in the object list at hass.0.entities.number.device.set_value it won't work. Neither home assistant changes the value nor the value is set in IOBroker. Also the entered number is displayed red.

I use the number entities with ESPHome on HA.

It work on previous versions of Home Assistant before. With an update of ha it stopped working. Could be 2-4 month or so . Unfortunately I can't tell exactly which version worked.

Screenshots & Logfiles
Log of IOBroker: Cannot control hass.0.entities.number.mg_eingang_people_counter.set_value: true

Versions:

Thanks for your support

Apollon77 commented 2 years ago

Please set the loglevel of the instance to debug and post the log from starting the adater and doing such a control action

Bark33p3r commented 2 years ago

I had to filter some logs because they were a few thousand: I hope there is anything in it what you need to know. If not please sent me a private message.

hass.0 | 2022-06-22 23:04:07.545 | debug | Found Entity service hass.0.entities.number.mg_eingang_people_counter.set_value: {"desc":"Set the value of a Number entity.","read":false,"write":true,"type":"mixed"} / {"fields":{"value":{"name":"Value","description":"The target value the entity should be set to.","example":42,"selector":{"text":null}}},"entity_id":"number.mg_eingang_people_counter","attr":"set_value","type":"number"} -- | -- | -- | -- hass.0 | 2022-06-22 23:04:07.545 | debug | Found Entity attribute hass.0.entities.number.mg_eingang_people_counter.mode: {"name":"mg-eingang people counter mode","read":true,"write":false,"type":"string"} / {"entity_id":"number.mg_eingang_people_counter","attr":"mode"} hass.0 | 2022-06-22 23:04:07.545 | debug | Found Entity attribute hass.0.entities.number.mg_eingang_people_counter.step: {"name":"mg-eingang people counter step","read":true,"write":false,"type":"number"} / {"entity_id":"number.mg_eingang_people_counter","attr":"step"} hass.0 | 2022-06-22 23:04:07.545 | debug | Found Entity attribute hass.0.entities.number.mg_eingang_people_counter.max: {"name":"mg-eingang people counter max","read":true,"write":false,"type":"number"} / {"entity_id":"number.mg_eingang_people_counter","attr":"max"} hass.0 | 2022-06-22 23:04:07.545 | debug | Found Entity attribute hass.0.entities.number.mg_eingang_people_counter.min: {"name":"mg-eingang people counter min","read":true,"write":false,"type":"number"} / {"entity_id":"number.mg_eingang_people_counter","attr":"min"} hass.0 | 2022-06-22 23:04:07.544 | debug | Found Entity state hass.0.entities.number.mg_eingang_people_counter.state: {"name":"mg-eingang people counter STATE","type":"string","read":true,"write":false} / {"entity_id":"number.mg_eingang_people_counter"} hass.0 | 2022-06-22 23:04:07.410 | debug | got answer for get_states success = true, result = {"entity_id":"number.mg_eingang_people_counter","state":"1.0","attributes":{"min":0,"max":10,"step":1,"mode":"auto","unit_of_measurement":"","icon":"mdi:counter","friendly_name":"mg-eingang people counter"},"last_changed":"2022-06-22T18:56:34.244530+00:00","last_updated":"2022-06-22T18:56:34.244530+00:00","context":{"id":"01G66CBYY4N9DEGXD4BFN49W98","parent_id":null,"user_id":null}}}]

I'm still curious that HA is always writing numbers as 1.0, 2.0, ... . Thank you really so much for all your support on IOBroker.

Apollon77 commented 2 years ago

If ok simply upload the log as file ... but I miss here especially your try to control the state and alao other infos are "rare" that way. I fyou have doubts because on the data send log via email to iobroker@fischer-ka.de and reference this issue

Apollon77 commented 2 years ago

Ok, I checked the log you sent ... and yes this all looks good ... but what I did not found in any log is a try to really set a value ... So please do that and send the debug log of that. Log line should be "Send to HASS for service ..." (but plesse not only this line, also some around

And yes "1.0" is a valid number, they just format it that way

Apollon77 commented 2 years ago

GitHub verison is updated, so please install this and try itand provide the above asked log with this version

Bark33p3r commented 2 years ago

I hope this does help you:

hass.0 | 2022-06-30 13:59:51.662 | debug | HASS-Message: State Changed: {"entity_id":"sensor.pcbathroommg_distance_zone_0","state":"2101","attributes":{"state_class":"measurement","unit_of_measurement":"mm","icon":"mdi:ruler","friendly_name":"pcbathroommg distance zone 0"},"last_changed":"2022-06-30T11:59:51.669160+00:00","last_updated":"2022-06-30T11:59:51.669160+00:00","context":{"id":"01G6T7PPBNCM1EMDXBWRHWH0ET","parent_id":null,"user_id":null}} -- | -- | -- | -- hass.0 | 2022-06-30 13:59:51.636 | error | Cannot control hass.0.entities.number.pcbathroommg_people_counter.set_value: true hass.0 | 2022-06-30 13:59:51.636 | debug | got answer for call_service success = false, result = undefined hass.0 | 2022-06-30 13:59:51.635 | debug | Send to HASS for service set_value with number and data {"entity_id":"number.pcbathroommg_people_counter"} hass.0 | 2022-06-30 13:59:50.816 | debug | HASS-Message: State Changed: {"entity_id":"sensor.k1_wohnzimmer_bh1750e","state":"16.4","attributes":{"state_class":"measurement","unit_of_measurement":"lx","device_class":"illuminance","friendly_name":"k1-wohnzimmer BH1750e"},"last_changed":"2022-06-30T11:59:50.823257+00:00","last_updated":"2022-06-30T11:59:50.823257+00:00","context":{"id":"01G6T7PNH7J418EAXDR3D7C7ZN","parent_id":null,"user_id":null}}
Apollon77 commented 2 years ago

Was this after installing the GitHub version???? If not please do,. If yes please install again from GitHub. I added a logline

Important: GitHub installs with npm 6 can take 10+mins. Just wait.

Bark33p3r commented 2 years ago

Thanks for the hint with the 10min + waiting It was the latest npm version mfrom github but i deleted the adapter, added it again and created the new instance.

log.txt

hass.0 | 2022-06-30 22:44:45.527 | debug | HASS-Message: State Changed: {"entity_id":"sensor.mg_eingang_rssi","state":"-70","attributes":{"state_class":"measurement","unit_of_measurement":"dBm","device_class":"signal_strength","friendly_name":"mg-eingang RSSI"},"last_changed":"2022-06-30T20:44:45.535595+00:00","last_updated":"2022-06-30T20:44:45.535595+00:00","context":{"id":"01G6V5QT2ZQV2GV4K0F9EFAHRT","parent_id":null,"user_id":null}} -- | -- | -- | -- hass.0 | 2022-06-30 22:44:40.311 | error | Cannot control hass.0.entities.number.pcbathroommg_people_counter.set_value: true hass.0 | 2022-06-30 22:44:40.310 | debug | got answer for call_service success = false, result = undefined hass.0 | 2022-06-30 22:44:40.309 | debug | Send to HASS for service set_value with number and data {"entity_id":"number.pcbathroommg_people_counter"} hass.0 | 2022-06-30 22:44:33.361 | debug | Initial parsing of states done, subscribe to ioBroker states hass.0 | 2022-06-30 22:44:32.113 | debug | Found Entity attribute hass.0.entities.sensor.speedtest_upload.bytes_sent: {"name":"SpeedTest Upload bytes sent","read":true,"write":false,"type":"number"} / {"entity_id":"sensor.speedtest_upload","attr":"bytes_sent"}

after restarts the first lines are:

hass.0 | 2022-06-30 22:44:31.722 | debug | Connected -- | -- | -- | -- hass.0 | 2022-06-30 22:44:31.721 | debug | got answer for subscribe_events success = true, result = null hass.0 | 2022-06-30 22:44:31.649 | info | starting. Version 1.2.0 in /opt/iobroker/node_modules/iobroker.hass, node: v14.19.3, js-controller: 4.0.23 hass.0 | 2022-06-30 22:44:31.566 | debug | Plugin sentry Initialize Plugin (enabled=true) hass.0 | 2022-06-30 22:44:27.869 | debug | Disconnected hass.0 | 2022-06-30 22:44:27.864 | info | Terminated (ADAPTER_REQUESTED_TERMINATION): Without reason hass.0 | 2022-06-30 22:44:27.864 | debug | Plugin sentry destroyed hass.0 | 2022-06-30 22:44:27.863 | info | terminating hass.0 | 2022-06-30 22:44:27.862 | info | Got terminate signal TERMINATE_YOURSELF

Do you see additional log line ? Additional you find the whole logfile as .txt from restart until 2 tries setting numbers.

Thanks a lot

Apollon77 commented 2 years ago

Honestly ... It do not seem to be the github version being installed because there we should see at least oen more logline when you try to control something.

YOu need to choose "install from Github" in the Admin install dialog and NOT "from npm"!

Bark33p3r commented 2 years ago

You're right. I installed from github and to add the instance I typed the npm command in. Now I just added the instance after installing the adapter. without any cli commands

... and now IT WORKS.

I guess I had the npm version before as well.

ass.0 | 2022-07-01 09:52:20.115 | debug | got answer for call_service success = true, result = {"context":{"id":"01G6WBY5WFPKN4J2ETCJPP9EDQ","parent_id":null,"user_id":"fbeb0fafa6c84e7d8c68988ccec21ac6"}} -- | -- | -- | -- hass.0 | 2022-07-01 09:52:20.111 | debug | Send to HASS for service set_value with number and data {"value":"3","entity_id":"number.pcbathroommg_people_counter"} hass.0 | 2022-07-01 09:52:20.111 | debug | Prepare service call for hass.0.entities.number.pcbathroommg_people_counter.set_value with (mapped) request parameters {"value":"3"}

Great thank you a lot for your support! Do you think this is a new stable version or do you need some guys to test it?

Apollon77 commented 2 years ago

Maybe you can also try to control other services ... also like lamps or such ... But I think Ican releas eit in Beta ... then we also get feedback :-)