Thermostat Value in Blocky or LUA

Moderator: leecollings

Post Reply
BarryT
Posts: 358
Joined: Tuesday 31 March 2015 22:06
Target OS: Linux
Domoticz version: 2024.3
Location: east netherlands
Contact:

Thermostat Value in Blocky or LUA

Post by BarryT »

Hi,

i want to change the temperature of a (virtual) thermostat in blocky, or lua..
Blocky dont let me change the value, and with http json it will change the value, but the (hardware/virtual) heating switch isnt activated (because the state stays on the same value)...

What i want is just my heating @15 degrees when nobody's at home, and 19 when someone is home.

why isnt this that simple, like other blocky stuff?

struggling for some hours and searched the hole web :(

thanks!

**Edit
It is working allready :)
Raspberry / ESP Boards / Relais / Milight / Hue / OTGW / P1 / Xiaomi / RFXCom / RFLink / ZWave / Conbee II / Z2M / MQTT / A lot of scripts and many more..
Software: Linux, Android and Windows
Mike70
Posts: 21
Joined: Thursday 22 October 2015 19:46
Target OS: Raspberry Pi / ODroid
Domoticz version: bèta
Location: Netherlands
Contact:

Re: Thermostat Value in Blocky or LUA

Post by Mike70 »

How did you do it?
I've got the same problem.
User avatar
Egregius
Posts: 2582
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Thermostat Value in Blocky or LUA

Post by Egregius »

You can control everything with the JSON API. A big part of them is explained at http://www.domoticz.com/wiki/Domoticz_API/JSON_URL's
Use the network view (developer mode) in your browser to see the commands when you use them in the UI of domoticz.
Sent that URL in blockly, LUA, PHP, or whatever.
User avatar
sincze
Posts: 1299
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: Thermostat Value in Blocky or LUA

Post by sincze »

I've been using the attached Thermostat.lua to control the floorheating in my house.
It works absolutely flawless.
First I solved it in Blocky, then I thought why not try LUA :D

I've defined several house_modes the thermostat.lua interacts with.
Please keep In mind I'm also using user_variables, as described here: https://www.domoticz.com/wiki/User_variables.

Maybe it will help somebody else as well.
This is a knowledge sharing forum :D
Attachments
script_time_thermostat.lua.txt
Thermostat.lua
(8.38 KiB) Downloaded 277 times
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
clkoolen
Posts: 6
Joined: Sunday 17 January 2016 19:45
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Thermostat Value in Blocky or LUA

Post by clkoolen »

Hello,

I am trying to do something completely different, but it does involve sending a json call through blockly. I tried the following:
Event with json.PNG
Event with json.PNG (26.58 KiB) Viewed 1779 times
However when I activate this the configuration state is not changed even though my log tells me " fetching url...."

I read that Sincze solved the json in blockly so I am interested in how that is parsed to see what I am doing wrong.

Thank you for your help.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests