Found the password. I was also able to read the data from my energylink, started a new topic for that how to integrate this.
I was able to integrate my switches and sensors in home assistant rfxcom. I saw a sensor was also integrated as a switch, I think I can just delete the switch part.
Also I’m trying to learn a new sensor on the rfxcom but can’t get this working with the info I find under rfxcom.
with this rest: script I can read out all the sensors.
However rest: only has sensor: and binary_sensor: variables, not a switch: variable.
I tried with a new command_line: script to turn on and off the switch and get the command_state from either value_json but I guess that only works in the rest: loop. A workaround it to put the switch status in a binary_sensor in the rest: loop.
On Tweakers (2 years ago) I found a solution:
It is unclear to my if that still within the sensor: template you proposed at that time.
Whatever I try or combine, I fail to get it working in the current rest: loop. Do you have any great suggestions or solutions?
I figured that out, but failed to get the actual status in the switch. We use these Kaku remote controls so do not always use Homewizard or Home Assistant to turn on/off lights.
Right now I have this, the rest: section retrieves all the sensors. I tried to put in the state of a switch in a binary_sensor hoping to read its state in the command_line: section.
rest:
- resource: http://IP/PW/get-status
scan_interval: 6
timeout: 4
sensor:
- name: Temperatuur binnen
unique_id: tempbinnen
value_template: "{{ value_json.response.heatlinks[0].rte | float(0)}}"
device_class: temperature
unit_of_measurement: "°C"
(a lot more sensors and binary_sensors)
binary_sensor:
- name: test
unique_id: bs0
value_template: "{{ value_json.response.switches[0].status == 'on' }}"
command_line:
- switch:
name: Appelboom
unique_id: switch0
command_on: curl http://IP/PW/sw/0/on
command_off: curl http://IP/PW/sw/0/off
command_state: "{{ states.binary_switch.test == 'on' }}"
Switching the lights on/off in the Appelboom works. Getting the state of the sensor template doesn’t. Could not be impossible what I want to achieve or?
Just try the following as I was struggling a long time ago with this, with some googling I came to the following and it worked. It can be that as per new update in December you have to check again as the rest and command line are changing in HA, have to figuring out then as well
And now with checking my configuration and changed the entitity is not available anymore for me and changed to read only status… Have to find out how to resolve them and make them available again… very frustrating sometimes as I can’t control the switches at the moment, temperature is available
If I read some comments on the forum about that “command line YAML configuration has moved” than you are not supposed to use it like “platform: command_line:”. Better/new way is starting with command_line: etc.
Is there anyone who can help me with getting the status in my switch without doing a curl (as the state is already retrieved in the rest: section)?
I am still trying but fail to get the way I want.
that’s what I understood as well that command line will change, few days probably that it will change, will check again as my states are now read only and trying as we speak to solve it.
Took more time than necessary because of the fact that reloading the yaml configs was not enough, only restarting the application gave the right results.
Although I now can read the status of Homewizard, it sometimes doesn’t respond (probably the wifi connection does not help).
In that case the sensor displays “became unavailable” in the log.
I tried several examples to detect this but I fail to get it working. Below I check if value_json is defined. Apparently it is defined but it still shows as niet beschikbaar in the log. I also saw other examples testing for unavailable, unknown, etc.
Can anyone help me here? Much appreciated.
rest:
- resource: http://IP/PW/get-status
scan_interval: 6
timeout: 4
binary_sensor:
- name: Achterdeur
unique_id: achterdeur
value_template: >-
{% if value_json is defined %}
{{ value_json.response.kakusensors[4].status == 'yes' }}
{% endif %}
Hi Briggy,
Can you tell more about reading the Homewizard data into Note-RED? Will it also help with the data 'became unavailable" issue when sometimes the Homewizard does net respond to the get-status command?
Eventually if you could share an example of Node-RED code, that would be super.
I was looking for days for Node-Red, expected it to be an integration, but it is an add-on…
Regards, Marco