Philio smart color button PSR04 as trigger

I got a Philio smart color button a couple of days ago and managed to get it connected to HASS, but i’m strugling to use it as a trigger for my automations. I’m trying to get it to toggle a tp-link HS100 which I’ve managed to control by clicking on the slider in the HASS webUI.
My end goal would be to tun the fan on for the number of minutes that the button sends (it also has a dial function), but I thought toggle would be a good start.

This is what my automations.yaml looks like: https://gist.github.com/Roshy10/7210d4e03d3301220f558fad7d3e53c0

I took a look in the OZW logs and saw it toggles a value from 0 to 99 each time you press it as shown here: https://gist.github.com/Roshy10/874423aacb6a32fce836868e52e74fec

If anyone can pont out what I’ve done wrong or point me in the right direction on what to do next that would be great!

I also have the XML for my network if that’s any help: https://gist.github.com/Roshy10/4364f43bade620e00fe181a84f2a0659

This is what the switch looks like in /dev-state: https://i.imgur.com/wubJe8m.png
(I can’t post more than two links at a time, sorry)

Did you get this working? or is there anyone else that got this working?

I’ve the same button and here is pastebin for log from zwave in hass.io.

Button tapped:
Received Central Scene set from node 17: scene id=1 in 0 seconds. Sending event notification.
Warning, Node017, No ValueID created for Scene 1
Detail, Node017,   Received: 0x01, 0x09, 0x00, 0x04, 0x00, 0x11, 0x03, 0x20, 0x01, 0x60, 0xa1
Detail,

Button turned to new position:
Info, Node017, Received Basic set from node 17: level=96. Treating it as a Basic report.
Detail, Node017, Refreshed Value: old value=0, new value=96, type=byte
Detail, Node017, Changes to this value are not verified
Detail, Node017, Notification: ValueChanged

https://pastebin.com/biMWMG09

Is it possible to do something with “Received Basic set from node 17: level=96. Treating it as a Basic report” in automation?

I was hoping to somehow use level=xx for automation

Hi, is this resolved in later versions? I have now version 0.47 and I can’t find an attribute that contains the dimming value.

Zwave attributes for Button are:

zwave.bedroom_light	Sleeping (CacheLoad)	is_failed: false
product_name: PSR04 Smart Color Button
receivedDups: 16
averageRequestRTT: 81
location: Bedroom
receivedUnsolicited: 44
sentTS: 2020-04-20 23:49:37:606 
capabilities: beaming,routing
receivedCnt: 44
max_baud_rate: 40000
manufacturer_name: Philio Technology Corporation
retries: 0
sentFailed: 0
lastResponseRTT: 0
battery_level: 40
averageResponseRTT: 0
node_id: 56
query_stage: CacheLoad
is_ready: false
new_entity_id: zwave.bedroom_light
wake_up_interval: 86400
receivedTS: 2020-04-20 23:50:06:055 
lastRequestRTT: 81
node_name: Bedroom Light
is_info_received: true
old_entity_id: zwave.bedroom_light_56
is_zwave_plus: true
friendly_name: Bedroom Light
sentCnt: 5
is_awake: false

But I resolved this with reading the basic report value directly from Zwave log. This is in my crontab:

@reboot tail -f /home/pi/.homeassistant/OZW_Log.txt | grep --line-buffered -Po "Info, Node056, Received 
Basic set from node 56: level=\K[^.]+" >> /home/pi/.homeassistant/ZwaveNode56.txt &

I first tried to read it with file sensor but it seems to be a bit too slow, so now I read it with command line

sensor: 
  - platform: command_line
    name: Light_Dimmer
    scan_interval: 1
    command: "tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt"

It’s not pretty but i works :slight_smile:

Installed MQTT and now there’s no delay.

added to crontab

@reboot tail -n1 -f /home/pi/.homeassistant/ZwaveNode56.txt | while read in; do mosquitto_pub  -h homeautomation -t "home/bedroom/dimmer" -m "$in"; done &

And sensor:

  - platform: mqtt
    state_topic: "home/bedroom/dimmer"
    name: Bedroom_Light_Dimmer
    unit_of_measurement: "%"

Had to add -a to grep command because one time grep thought zwave log was a binary file.

Hi there :grinning:

I have the same buttons i bought

I`m not so experienced with HA jet, could anybody help with the code i need to get the Philio PSR04-1 working please

I like to use the center button function as on/of and rotation for the dimming part

Thx in advance

@reboot tail -f /home/pi/.homeassistant/OZW_Log.txt | grep -a --line-buffered -Po "Info, Node056, Received Basic set from node 56: level=\K[^.]+" >> /home/pi/.homeassistant/ZwaveNode56.txt &

I don’t have this working any more because I have now Ikea Volume-buttons. But this is in pi’s crontab and reads Zwave log (/home/pi/.homeassistant/OZW_Log.txt), searches level set notification for Node056 and outputs the level to file /home/pi/.homeassistant/ZwaveNode56.txt

@reboot tail -n1 -f /home/pi/.homeassistant/ZwaveNode56.txt | while read in; do mosquitto_pub  -r -h homeautomation -t "home/bedroom/dimmer" -m "$in"; done &

This is also in pi’s crontab. It reads the file the other command appends and sends it via mosquitto_pub (MQTT) to topic “home/bedroom/dimmer”

In HA configuration.yaml:

mqtt:
  sensor:
  - name: Bedroom_Light_Dimmer
    state_topic: "home/bedroom/dimmer"
    unit_of_measurement: "%"

Hi,

Thank you so much for responding!
I did answer you in person so that was my mistake

I dont understand everything your saying, please treed me like a beginner, i have only Tasmota devices till now…
But i have configured the zooz 800 usb stick and bought some z-wave dimmers wich i like to control wit these prs04 buttons

I do understand the configuration.yaml file bit
but what do you mean by

@reboot tail -n1 -f /home/pi/.homeassistant/ZwaveNode56.txt | while read in; do mosquitto_pub  -r -h homeautomation -t "home/bedroom/dimmer" -m "$in"; done &

Where do i put this info

Sorry for all the questions :grinning:

Thx in advance

I have that in my pi-users crontab. Login to user that’s running HA, and ‘crontab -e’ gets you to edit crontab. @reboot means the command is run at reboot so you have to reboot the system to get it running.
That command reads file ZwaveNode56.txt that the other command creates. And sends it with mosquitto ( you have to install mosquitto)
You can also run the commands manually for testing.

i have found those errors in /homeassistant/home-assistant.log.1

2023-12-06 14:48:10.881 ERROR (SyncWorker_6) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt
2023-12-06 14:48:11.881 ERROR (SyncWorker_17) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt
2023-12-06 14:48:12.882 ERROR (SyncWorker_19) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt
2023-12-06 14:48:13.883 ERROR (SyncWorker_1) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt
2023-12-06 14:48:14.884 ERROR (SyncWorker_9) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt
2023-12-06 14:48:15.884 ERROR (SyncWorker_8) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt
2023-12-06 14:48:16.885 ERROR (SyncWorker_5) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt
2023-12-06 14:48:17.887 ERROR (SyncWorker_0) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt
2023-12-06 14:48:18.889 ERROR (SyncWorker_10) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt
2023-12-06 14:48:19.890 ERROR (SyncWorker_14) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt
2023-12-06 14:48:20.891 ERROR (SyncWorker_6) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt
2023-12-06 14:48:21.893 ERROR (SyncWorker_17) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt
2023-12-06 14:48:22.894 ERROR (SyncWorker_19) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt
2023-12-06 14:48:23.897 ERROR (SyncWorker_1) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt
2023-12-06 14:48:24.898 ERROR (SyncWorker_9) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt
2023-12-06 14:48:25.898 ERROR (SyncWorker_8) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt
2023-12-06 14:48:26.899 ERROR (SyncWorker_5) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt
2023-12-06 14:48:27.901 ERROR (SyncWorker_0) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt
2023-12-06 14:48:28.903 ERROR (SyncWorker_10) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt
2023-12-06 14:48:29.904 ERROR (SyncWorker_2) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt
2023-12-06 14:48:30.905 ERROR (SyncWorker_14) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt
2023-12-06 14:48:31.906 ERROR (SyncWorker_6) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt
2023-12-06 14:48:32.907 ERROR (SyncWorker_17) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt
2023-12-06 14:48:33.909 ERROR (SyncWorker_19) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt
2023-12-06 14:48:34.910 ERROR (SyncWorker_1) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt
2023-12-06 14:48:35.910 ERROR (SyncWorker_9) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt
2023-12-06 14:48:36.911 ERROR (SyncWorker_8) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt
2023-12-06 14:48:37.913 ERROR (SyncWorker_5) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt
2023-12-06 14:48:38.914 ERROR (SyncWorker_0) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt
2023-12-06 14:48:39.915 ERROR (SyncWorker_10) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt
2023-12-06 14:48:40.915 ERROR (SyncWorker_2) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt
2023-12-06 14:48:41.916 ERROR (SyncWorker_14) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt
2023-12-06 14:48:42.918 ERROR (SyncWorker_6) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt
2023-12-06 14:48:43.918 ERROR (SyncWorker_17) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt
2023-12-06 14:48:44.919 ERROR (SyncWorker_19) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt
2023-12-06 14:48:45.920 ERROR (SyncWorker_1) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt
2023-12-06 14:48:46.920 ERROR (SyncWorker_9) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt
2023-12-06 14:48:47.921 ERROR (SyncWorker_8) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt
2023-12-06 14:48:48.923 ERROR (SyncWorker_5) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt
2023-12-06 14:48:49.923 ERROR (SyncWorker_0) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt
2023-12-06 14:48:50.925 ERROR (SyncWorker_10) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt
2023-12-06 14:48:51.926 ERROR (SyncWorker_2) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt
2023-12-06 14:48:52.925 ERROR (SyncWorker_17) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt
2023-12-06 14:48:53.926 ERROR (SyncWorker_19) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt
2023-12-06 14:48:54.927 ERROR (SyncWorker_9) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt
2023-12-06 14:48:55.949 ERROR (SyncWorker_0) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt
2023-12-06 14:48:56.933 ERROR (SyncWorker_17) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt
2023-12-06 14:48:57.934 ERROR (SyncWorker_19) [homeassistant.components.command_line.utils] Command failed (with return code 1): tail -n 1 /home/pi/.homeassistant/ZwaveNode56.txt

I have mqtt up and running, i use mqtt for tasmota aswel

just ran the command line

getting this

I`m running Ha on in a virtual environment on a Synology Nas

Now I have to say I’m sorry, but those scripts assumed that user has basic knowledge of linux commands and crontab. I’m not going to start debugging for different environment…

Oke i understand,

And this is because there are so many errors i assume wich i have to figure out first?

And start learning more in linux? you are right i know nothing of linux.

Could you point me to a direction wich is a good place to learn maybe?

Read crontab manual so you understand it’s syntax.
In linux read the my command lines how data is transferred in input, output, piping.
Read what the commands are like tail, grep. Your linux might have different versions, so they might not work similarly. Or the files are in other directories.
For instance, run

 tail -f /home/pi/.homeassistant/OZW_Log.txt

and you find it shows all new lines that are written to your zwave log ( if that is where your zwave log is )
Both lines start with “tail -f” because it feeds to file to other commands via piping. |

HA doesn’t use OZW anymore.

My help was intended for versions where PSR04 does not work.

My point is that the OZW_Log.txt file doesn’t exist anymore, so this method is no longer valid. HA hasn’t used OZW for almost 3 years.

I didn’t know it’s only allowed to discuss the latest versions?
My current version is 2022.6.