I have a working DS18B20 tempsensor in a Pythonscript and i want to send the sensors value to Zwave.
How do i set up the script to send the value and how do i set up for an example Codedevice to collect those values?
Best regards/
Marcus
Send outside tempsensor value to Zwave
Re: Send outside tempsensor value to Zwave
Did you try a search in this forum ?
You are half way there with this !
https://forum.z-wave.me/viewtopic.php?f=3422&t=33319
Then my Arduino runs this, you could work out what it is doing and put that into a Python script.
void zwtemperature() //Tell zway the new temperature setting
{
zwaydevice=(F("HTTP_Device_switchMultilevel_276"));
zwaycommand=(F("exact?level="));
zwaycommand=zwaycommand+thermostat+'"';
zwayset();
}
void zwayset()
{
if (client.connect(server_zway, 8083)) //connect to zway
{
// client.print(F("GET /ZAutomation/api/v1/devices/ZWayVDev_zway_"));
client.print(F("GET /ZAutomation/api/v1/devices/"));
client.print(zwaydevice);
client.print(F("/command/"));
client.print(zwaycommand);
client.println(F(" HTTP/1.0")); // "on" or "off" or "update"
client.println(F("Authorization: Basic xxxxxxxxxxxxxxxxxx)); //BASE64 of username:password
client.println();
getresponse();
}
else
{
//Serial.println("connection to z-way failed");
}
I'm using HTTP Device, not Code Device this time.
screenshot of the settings
https://ibb.co/98kdrTX
You are half way there with this !
https://forum.z-wave.me/viewtopic.php?f=3422&t=33319
Then my Arduino runs this, you could work out what it is doing and put that into a Python script.
void zwtemperature() //Tell zway the new temperature setting
{
zwaydevice=(F("HTTP_Device_switchMultilevel_276"));
zwaycommand=(F("exact?level="));
zwaycommand=zwaycommand+thermostat+'"';
zwayset();
}
void zwayset()
{
if (client.connect(server_zway, 8083)) //connect to zway
{
// client.print(F("GET /ZAutomation/api/v1/devices/ZWayVDev_zway_"));
client.print(F("GET /ZAutomation/api/v1/devices/"));
client.print(zwaydevice);
client.print(F("/command/"));
client.print(zwaycommand);
client.println(F(" HTTP/1.0")); // "on" or "off" or "update"
client.println(F("Authorization: Basic xxxxxxxxxxxxxxxxxx)); //BASE64 of username:password
client.println();
getresponse();
}
else
{
//Serial.println("connection to z-way failed");
}
I'm using HTTP Device, not Code Device this time.
screenshot of the settings
https://ibb.co/98kdrTX
Raspi 4 - (Buster - 32 Bit) Zwave Version 4.1.1, Raz 7 Pro, Serial API Version: 07.38
Re: Send outside tempsensor value to Zwave
Hi and thanks for reply.
By using this formula i can change the level on a switchMultilevel to level 9:
but when using the sensorMultilevel i cant change it with the same formula, i guess i should use a different formula for sensors, any idea?
Best regards/
Marcus
By using this formula i can change the level on a switchMultilevel to level 9:
Code: Select all
/ZAutomation/api/v1/devices/HTTP_Device_switchMultilevel_44/command/exact?level=9
Best regards/
Marcus
Re: Send outside tempsensor value to Zwave
you can change a switch, but not a sensor. Sensor is a read-only feature. switch is an actor and you can modify it's state.
Re: Send outside tempsensor value to Zwave
I see, thanks for clearing that out