Page 1 of 1

Heatpump rules - not working

Posted: Thursday 15 December 2016 14:50
by ksga
Hi. I'm trying to get my first Blockly working - and so far mixed success...
I'm trying to setup something that will keep my apartment in a reasonable heated/cooled state when I'm away for a couple of days/weeks.

I started out with a simple "if lower than 26C, then turn on inverter on heat setting" sort of thing. Worked fine..

But when I added the "else if" statement, it stopped working.

What I'm trying to accomplish with the script below is:
1. If its colder than 26C (temperatures will be adjusted before I leave it to do its thing...) turn on the AC/heatpump in "Heat" mode - 20% level on my multi selector switch.
2. If its warmer than 30C turn on the AC/heatpump in "Cool" mode - 30% level.
3. If its somewhere between 27C and 29C turn off the AC/heatpump - but only if it is not already turned off (the thing makes an annoying beep sound every time it receives a command - also if its the same as the last one)
heatpump.PNG
heatpump.PNG (33.67 KiB) Viewed 2112 times
Nothing is happening, nothing in the log - so what am I missing??? (apart from any clue what I'm doing obviously :) )

Re: Heatpump rules - not working

Posted: Tuesday 10 January 2017 18:34
by tnegun
Did you ever find a solution? I'm having the same issue with IF/ElseIF statements IF/Do work ok though

Re: Heatpump rules - not working

Posted: Tuesday 10 January 2017 18:45
by Egregius
Use a script and you can do whatever you want. Seems pretty basic stuff above :P

Re: Heatpump rules - not working

Posted: Tuesday 10 January 2017 20:05
by tnegun
I'm lazy :) is it a bug or expected that selector switches don't work with If Else blocklys?

Re: Heatpump rules - not working

Posted: Tuesday 10 January 2017 22:28
by Nautilus
tnegun wrote:I'm lazy :) is it a bug or expected that selector switches don't work with If Else blocklys?
Should work. Couple of notes though.
1. Maybe it is supposed to be so but from 26 to 27 and 29 to 30 the scripts does nothing.
2. When checking a selector switch state you are not checking the level but the actual value of the state. So if Level 0 name is .e.g. "Off" you need to compare against that in the last "else if"

Trust you've made sure the event is marked active and type device? Maybe add some logging to try to see what is happening..

Re: Heatpump rules - not working

Posted: Tuesday 10 January 2017 23:20
by tnegun
Just updated to 3.6328

I just realized I'm not doing the same as the OP. I'm acting ont the selector state not setting it.

e.g. This works properly
Image

but this doesn't
Image

Re: Heatpump rules - not working

Posted: Tuesday 10 January 2017 23:31
by Nautilus
tnegun wrote:Just updated to 3.6328

I just realized I'm not doing the same as the OP. I'm acting ont the selector state not setting it.

e.g. This works properly
Image

but this doesn't
Image
Sorry, missed the fact you were not the OP :) There the problem is the If-block type, the one with the blue icon on top left corner requires an "else if" as well. Plain "if -> do" works only with the version without this icon.

Re: Heatpump rules - not working

Posted: Tuesday 10 January 2017 23:52
by tnegun
And thats working.... I was testing by building in stages and got stuck here!!

Thanks for your help :)