Yes, that is possible, but not very nice…check tester and multi-functional below:
It takes out the toggle, which i could live with, (replaces it with an active and inactive lightning bolt) but it stops communication from the switch to the frontend. Iow, one can switch from within HA successfully, but if the switch is toggled manually on the hardware-switch, it doesn’t show in the front end.
Which leads me back to the question if we can adjust the polling time of the state command_line?
to be complete, this is the code right now, i left the logical test intact hoping it would see it, but i think it isnt used now since ive taken out the State command:
sw_tester_cl:
friendly_name: 7 - Tester
command_on: >-
curl -X POST -d '{"seq":1, "method":"object_prop_set", "arguments":{"oid":"4e6eeb01", "prop":"command", "value":"on"}}' http://192.168.xxx.xxx/iungo/api_request
command_off: >-
curl -X POST -d '{"seq":1, "method":"object_prop_set", "arguments":{"oid":"4e6eeb01", "prop":"command", "value":"off"}}' http://192.168.xxx.xxx/iungo/api_request
# command_state: >-
# curl -X POST -d '{"seq":1, "method":"object_prop_get", "arguments":{"oid":"4e6eeb01", "prop":"state"}}' http://192.168.xxx.xxx/iungo/api_request
value_template: >-
{%- if value_json.rv.value == 'on' -%}
{{ true }}
{%- else -%}
{{ false }}
{%- endif -%}
sw_multi_functional_cl:
friendly_name: 8 - Multi Functional
command_on: >-
curl -X POST -d '{"seq":1, "method":"object_prop_set", "arguments":{"oid":"7b4d9b1b", "prop":"command", "value":"on"}}' http://192.168.xxx.xxx/iungo/api_request
command_off: >-
curl -X POST -d '{"seq":1, "method":"object_prop_set", "arguments":{"oid":"7b4d9b1b", "prop":"command", "value":"off"}}' http://192.168.xxx.xxx/iungo/api_request
# command_state: >-
# curl -X POST -d '{"seq":1, "method":"object_prop_get", "arguments":{"oid":"7b4d9b1b", "prop":"state"}}' http://192.168.xxx.xxx/iungo/api_request
value_template: >-
{%- if value_json.rv.value == 'on' -%}
{{ true }}
{%- else -%}
{{ false }}
{%- endif -%}
ive tried this workaround by creating binary sensors based on their usage, and show these in the frontend as extra-badges:
As you can see it gets very crowded, and yet, the switches report incorrectly. Binary sensor and usage show Off or zero , while the bolt is highlighted and the multi_functional icon is hot.
Back to original quickly
Thanks,
Marius