How to acces the defined units

Python and python framework

Moderator: leecollings

Post Reply
Ewaldharmsen
Posts: 130
Joined: Tuesday 07 February 2017 15:00
Target OS: Linux
Domoticz version:
Contact:

How to acces the defined units

Post by Ewaldharmsen »

Hi all, I want to retrieve the units set in the settings page like "kilograms" or "m/s". They are currently not in the json output or Setting dict.

IS this not possible to retrieve?
Xorfor

Re: How to acces the defined units

Post by Xorfor »

I am working on a Python API for Domoticz which will use the API/JSON URL's from Domoticz. There are a lot of 'undocumented' URL's. So it is possible to retrieve the settings with:

Code: Select all

/json.htm?type=settings
There you will find eg.:

"WeightUnit" where the value 0 = "Kilograms", 1 = "Pounds"
"WindUnit" where the value 0 = "m/s", 1 = "km/h", 2 = "mph", 3 = "Knots", 4 = "Beaufort"

Hope this helps?
Ewaldharmsen
Posts: 130
Joined: Tuesday 07 February 2017 15:00
Target OS: Linux
Domoticz version:
Contact:

Re: How to acces the defined units

Post by Ewaldharmsen »

ah thanks! This helps!
Is there also a temperature setting?
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: How to acces the defined units

Post by waaren »

Ewaldharmsen wrote: Friday 04 January 2019 8:58 ah thanks! This helps!
Is there also a temperature setting?
Yes; "TempUnit"
Spoiler: show

Code: Select all

{
"AcceptNewHardware": 0,
"ActiveTimerPlan": 0,
"AllowWidgetOrdering": 1,
"AuthenticationMethod": 1,
"BatterLowLevel": 0,
"CM113DisplayType": 0,
"ClickatellAPI": "",
"ClickatellEnabled": "",
"ClickatellFrom": "",
"ClickatellPassword": "",
"ClickatellTo": "",
"ClickatellUser": "",
"CostEnergy": "0.2149",
"CostEnergyR1": "0.2149",
"CostEnergyR2": "0.2149",
"CostEnergyT2": "0.2149",
"CostGas": "0.6218",
"CostWater": "2.1000",
"DashboardType": 0,
"DegreeDaysBaseTemperature": "18.0",
"DisableDzVentsSystem": 0,
"DoorbellCommand": 0,
"DzVentsLogLevel": 2,
"ElectricVoltage": 230,
"EmailAsAttachment": "",
"EmailEnabled": 1,
"EmailFrom": "*************",
"EmailPassword": "*************",
"EmailPort": 587,
"EmailServer": "smtp.gmail.com",
"EmailTo": "*************",
"EmailUsername": "*************",
"EnableEventScriptSystem": 1,
"EnableTabCustom": 1,
"EnableTabFloorplans": 1,
"EnableTabLights": 1,
"EnableTabScenes": 1,
"EnableTabTemp": 1,
"EnableTabUtility": 1,
"EnableTabWeather": 1,
"EnergyDivider": 1000,
"FloorplanActiveOpacity": 25,
"FloorplanAnimateZoom": 1,
"FloorplanFullscreenMode": 0,
"FloorplanInactiveOpacity": 5,
"FloorplanPopupDelay": 750,
"FloorplanRoomColour": "Blue",
"FloorplanShowSceneNames": 0,
"FloorplanShowSensorValues": 1,
"FloorplanShowSwitchValues": 0,
"GCMEnabled": 1,
"GasDivider": 10000,
"HTTPEnabled": "",
"HTTPField1": "",
"HTTPField2": "",
"HTTPField3": "",
"HTTPField4": "",
"HTTPPostContentType": "*************",
"HTTPPostData": "",
"HTTPPostHeaders": "",
"HTTPTo": "",
"HTTPURL": "*************",
"HideDisabledHardwareSensors": 1,
"IFTTTAPI": "*************",
"IFTTTEnabled": 1,
"KodiEnabled": "",
"KodiIPAddress": "224.0.0.1",
"KodiPort": 9777,
"KodiTimeToLive": 5,
"Language": "en",
"LightHistoryDays": 30,
"LmsDuration": 5,
"LmsEnabled": "",
"LmsPlayerMac": "",
"Location": {
"Latitude": "*************",
"Longitude": "*************"
},
"LogEventScriptTrigger": 0,
"MobileType": 0,
"MyDomoticzSubsystems": 1,
"MyDomoticzUserId": "",
"NotificationSensorInterval": 43200,
"NotificationSwitchInterval": 0,
"ProtectionPassword": "*************",
"ProwlAPI": "*************",
"ProwlEnabled": 1,
"PushALotAPI": "",
"PushALotEnabled": "",
"PushbulletAPI": "*************",
"PushbulletEnabled": "",
"PushoverAPI": "*************",
"PushoverEnabled": 1,
"PushoverUser": "*************",
"PushsaferAPI": "*************",
"PushsaferEnabled": 1,
"PushsaferImage": "",
"RandomTimerFrame": 15,
"RaspCamParams": "-w 800 -h 600 -t 1",
"ReleaseChannel": 1,
"RemoteSharedPort": 6144,
"SecOnDelay": 2,
"SecPassword": "*************",
"SendErrorsAsNotification": 0,
"SensorTimeout": 60,
"ShortLogDays": 1,
"ShortLogInterval": 5,
"ShowUpdateEffect": 1,
"SmartMeterType": 0,
"TelegramAPI": "*************",
"TelegramChat": "*************",
"TelegramEnabled": 1,
"TempUnit": 0,
"Title": "Domoticz",
"UVCParams": "-S80 -B128 -C128 -G80 -x800 -y600 -q100",
"UseAutoBackup": 1,
"UseAutoUpdate": 0,
"UseEmailInNotifications": 1,
"WaterDivider": 100,
"WebLocalNetworks": "127.0.0.*",
"WebRemoteProxyIPs": "",
"WebTheme": "machinon-beta",
"WebUserName": "*************",
"WeightUnit": 0,
"WindUnit": 4,
"cloudenabled": true,
"status": "OK",
"title": "settings"
}
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Post Reply