Hello,
I have an wlan Temperature Sensor wich an esp8266.
How can i Show the value in zwave ?
Can i send an api request to an virtual device ? , to transmit value ?
Virtual device over api from esp8266
Virtual device over api from esp8266
Greetings from germany
Jörg
Raspi 4(Buster), Zwave Version 4.1.1 Raz 7 Pro, Serial API Version:07.38(SDK 7.20)
Jörg
Raspi 4(Buster), Zwave Version 4.1.1 Raz 7 Pro, Serial API Version:07.38(SDK 7.20)
Re: Virtual device over api from esp8266
This command works from my Arduino device. Similar or same as esp8266.
----ZAutomation/api/v1/devices/HTTP_Device_switchMultilevel_276/command/exact?level=50
Have you already sorted out the password, login details.
You need to setup z-way virtual device as a Switch. You can't update a Sensor. (They look the same in GUI anyway).
See below how I build the string to send.
Hope it helps.
-----------------------------------------------------------------
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/"));
client.print(zwaydevice);
client.print(F("/command/"));
client.print(zwaycommand); // "on" or "off" or "update"
client.println(F(" HTTP/1.0"));
client.println(F("Authorization: Basic YourBase64password")); //arduino BASE64 of 'username:password' (with unix eol converted using notepad++)
client.println();
getresponse();
}
else
{
//Serial.println("connection to z-way failed");
}
}
//-----------------------------------------------------
----ZAutomation/api/v1/devices/HTTP_Device_switchMultilevel_276/command/exact?level=50
Have you already sorted out the password, login details.
You need to setup z-way virtual device as a Switch. You can't update a Sensor. (They look the same in GUI anyway).
See below how I build the string to send.
Hope it helps.
-----------------------------------------------------------------
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/"));
client.print(zwaydevice);
client.print(F("/command/"));
client.print(zwaycommand); // "on" or "off" or "update"
client.println(F(" HTTP/1.0"));
client.println(F("Authorization: Basic YourBase64password")); //arduino BASE64 of 'username:password' (with unix eol converted using notepad++)
client.println();
getresponse();
}
else
{
//Serial.println("connection to z-way failed");
}
}
//-----------------------------------------------------
Raspi 4 - (Buster - 32 Bit) Zwave Version 4.1.1, Raz 7 Pro, Serial API Version: 07.38
Re: Virtual device over api from esp8266
Hello Mickey,
thanks for your answer...
I want to update an Sensor device![Smile :-)](./images/smilies/icon_e_smile.gif)
Is there any way do show an Value for an External Sensor ?
thanks for your answer...
I want to update an Sensor device
![Smile :-)](./images/smilies/icon_e_smile.gif)
Is there any way do show an Value for an External Sensor ?
Greetings from germany
Jörg
Raspi 4(Buster), Zwave Version 4.1.1 Raz 7 Pro, Serial API Version:07.38(SDK 7.20)
Jörg
Raspi 4(Buster), Zwave Version 4.1.1 Raz 7 Pro, Serial API Version:07.38(SDK 7.20)
Re: Virtual device over api from esp8266
by PoltoS » 18 Mar 2020 21:03
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.
I just tried sending the same command to a sensorMultilevel device.
The command is accepted ! but the sensor data is not updated.
As a work around, set your virtual device up as a Switch, it still shows the correct Temperature.
A harder alternative is to setup z-way as a Http sensorMultilevel
And get z-way to send the http request to your esp8266
Your esp8266 will need to be waiting for http commands, then your esp8266 will respond back to z-way with the Temperature reading.
This relies on z-way requesting the update. (you can get the esp8266 to tell z-way to request it updates the sensor)
It's been 2 years since I set this up.
Maybe someone else has found a better way since then !
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.
I just tried sending the same command to a sensorMultilevel device.
The command is accepted ! but the sensor data is not updated.
As a work around, set your virtual device up as a Switch, it still shows the correct Temperature.
A harder alternative is to setup z-way as a Http sensorMultilevel
And get z-way to send the http request to your esp8266
Your esp8266 will need to be waiting for http commands, then your esp8266 will respond back to z-way with the Temperature reading.
This relies on z-way requesting the update. (you can get the esp8266 to tell z-way to request it updates the sensor)
It's been 2 years since I set this up.
Maybe someone else has found a better way since then !
Raspi 4 - (Buster - 32 Bit) Zwave Version 4.1.1, Raz 7 Pro, Serial API Version: 07.38
Re: Virtual device over api from esp8266
Hello,
Thanks a lot...
That ist my way, so far ...A harder alternative is to setup z-way as a Http sensorMultilevel
And get z-way to send the http request to your esp8266
Your esp8266 will need to be waiting for http commands, then your esp8266 will respond back to z-way with the Temperature reading.
This relies on z-way requesting the update. (you can get the esp8266 to tell z-way to request it updates the sensor)
Thanks a lot...
Greetings from germany
Jörg
Raspi 4(Buster), Zwave Version 4.1.1 Raz 7 Pro, Serial API Version:07.38(SDK 7.20)
Jörg
Raspi 4(Buster), Zwave Version 4.1.1 Raz 7 Pro, Serial API Version:07.38(SDK 7.20)