Jufo wrote:
Good!. How to start?

))
First, decide how many screens you want, and what you want to display in each screen
- you can rename / add / delete the def screen_xxx() sections, but ensure that all the names are in the screens dictionary immediately afterwards, and that TotalScreens is correct.
Then, for each screen, change the lcd.display_string_l lines to correspond to
your Domoticz devices
- change the text to appear at the left
- the parameter in get_domoticz_sensor() is the idx of the Domoticz device, as found in the Setup > Devices page
- the value in [] is the key of the data item from the JSON for that device (see below)
- add any text to appear on the right
- the last number is the row on the screen.
To find the key of the data item to display, you'll need to type the following in your browser:
Code: Select all
http://<Domoticz URL>:<port>/json.htm?type=devices&rid=<idx>
(replacing values in angle brackets as appropriate)
For example in my system, one of my temperature devices (called "Lounge") has idx = 211, so typing
Code: Select all
http://192.168.0.63:8080/json.htm?type=devices&rid=211
I get:
- Spoiler: show
Code: Select all
{
"ActTime": 1487542149,
"ServerTime": "2017-02-19 22:09:09",
"Sunrise": "07:10",
"Sunset": "17:24",
"result":
[
{
"AddjMulti": 1.0,
"AddjMulti2": 1.0,
"AddjValue": 0.0,
"AddjValue2": 0.0,
"Barometer": 1023.4,
"BatteryLevel": 72,
"CustomImage": 0,
"Data": "22.8 C, 41 %, 1023.4 hPa",
"Description": "",
"DewPoint": "8.86",
"Favorite": 1,
"Forecast": 5,
"ForecastStr": "Some Clouds",
"HardwareID": 24,
"HardwareName": "MySensors_2",
"HardwareType": "MySensors Gateway USB",
"HardwareTypeVal": 41,
"HaveTimeout": false,
"Humidity": 41,
"HumidityStatus": "Comfortable",
"ID": "1303",
"LastUpdate": "2017-02-19 22:04:51",
"Name": "Lounge",
"Notifications": "false",
"PlanID": "2",
"PlanIDs":
[
2
],
"Protected": false,
"ShowNotifications": true,
"SignalLevel": "-",
"SubType": "Weather Station",
"Temp": 22.8,
"Timers": "false",
"Type": "Temp + Humidity + Baro",
"TypeImg": "temperature",
"Unit": 3,
"Used": 1,
"XOffset": "350",
"YOffset": "277",
"idx": "211"
}
],
"status": "OK",
"title": "Devices"
}
The value I want is "Temp", so my code for this is:
Code: Select all
lcd_string("Lounge : " + str(get_domoticz_sensor(211)["Temp"]) + deg,2)
I hope this helps.