kinou74 / Domoticz-Palazzetti

Domoticz Python Plugin for Palazzetti Connection Box
GNU General Public License v3.0
8 stars 3 forks source link

Plugin not working due to changes on commands #1

Open RonandoDeLaVega opened 5 years ago

RonandoDeLaVega commented 5 years ago

It seems that palazzetti has changed its commands ; the plugin does not work anymore.

Before: http://{IPofCBox}/sendmsg.php?cmd={CommandeComplete}

Now: http://{IPofCBox}/cgi-bin/sendmsg.lua?cmd={CommandeComplete}

kinou74 commented 5 years ago

Hello Ronando,

Thanks a lot for your feedback ! Indeed, i've been reported that Palazzetti released an upgrade of their connection box some months ago and they've changed the internal API to use LUA instead of PHP. I'll update the plugin in the coming days to add an option to use the new LUA API, knowing that my box is still using the PHP one and I don't intend to update it due to the encountered issues reported from users and my dealer (that stove firmware may has to be upgraded too in some case !) For information, I don't use the Palazzetti mobile app and I've blocked the communication from the box to the Internet for security and privacy reasons. I keep you informed.

RonandoDeLaVega commented 5 years ago

Hello kinou74,

Thanks for the quick answer ! What a gret work you've done with this plugin, I'm looking forward to test it ! Thanks a lot for sharing too !

How do you get the technical informations of the request to the box ? Is there an official document of Palazzetti ?

I had a hard time to understand that the issue I had on my Domoticz (fresh install, first plugin :-D) came from this. I'll try to make a factory reset of the CBox to see if it downgrades the firmware.

Thanks, Ronando

kinou74 commented 5 years ago

Hello Ronando,

Most of the information are gathered from a French forum originally dedicated to LOLA Palazzetti stove and from a retro-engineering of the web application embedded in the box.

According to what I've read so far, the change is not as easier as changing the api URL; the json results format is also different and it's gonna be a little bit more complicated, specially if I've don't get the right box at home...

Anyway, please, could you transmit/attach the json results for the following commands: http://{IPofCBox}/cgi-bin/sendmsg.lua?cmd=GET+ALLS http://{IPofCBox}/cgi-bin/sendmsg.lua?cmd=GET+CHRD http://{IPofCBox}/cgi-bin/sendmsg.lua?cmd=SET+RFAN+0 http://{IPofCBox}/cgi-bin/sendmsg.lua?cmd=SET+POWR+3

The 2 last commands will set the room speed to Auto and Power to level 3

Thanks !

RonandoDeLaVega commented 5 years ago

Hello Kinou74,

Here are the results of the commands :

{"INFO":{"RSP":"OK","CMD":"GET ALLS","TS":1542230998},"SUCCESS":true,"DATA":{"LSTATUS":1,"F2LF":2,"T5":19.9,"PQT":213,"PUMP":0,"T4":0,"PWR":3,"CHRSTATUS":1,"T3":51,"T2":30.3,"T1":0,"F1V":0,"IN":9,"DP":95,"FANLMINMAX":[0,5,0,1,0,1],"FDR":0,"F3L":0,"OUT":0,"F2V":0,"MOD":393,"DPT":0,"APLWDAY":3,"FWDATE":"2016-04-15","STATUS":1,"F2L":7,"SETP":21,"F4L":0,"APLTS":"2018-11-14 22:29:44","F1RPM":0,"MAC":"40:F3:85:70:20:C1","VER":48,"MBTYPE":0}}

{"INFO":{"RSP":"OK","CMD":"GET CHRD","TS":1542231067},"SUCCESS":true,"DATA":{"D2":{"M3":"OFF","M2":"P4","M1":"P1"},"D3":{"M3":"OFF","M2":"P4","M1":"P1"},"D1":{"M3":"OFF","M2":"P3","M1":"P2"},"D7":{"M3":"OFF","M2":"OFF","M1":"P5"},"D6":{"M3":"OFF","M2":"OFF","M1":"P5"},"D5":{"M3":"OFF","M2":"P4","M1":"P1"},"CHRSTATUS":1,"P6":{"CHRSETP":23,"START":"21:30","STOP":"22:30"},"P5":{"CHRSETP":20,"START":"07:00","STOP":"22:00"},"P4":{"CHRSETP":21,"START":"16:00","STOP":"22:00"},"P2":{"CHRSETP":20,"START":"06:15","STOP":"12:30"},"P3":{"CHRSETP":21,"START":"17:00","STOP":"22:00"},"D4":{"M3":"OFF","M2":"P3","M1":"P2"},"P1":{"CHRSETP":20,"START":"06:15","STOP":"08:30"}}}

{"INFO":{"RSP":"OK","CMD":"SET RFAN","TS":1542231051},"SUCCESS":true,"DATA":{"F2L":0,"F2LF":0,"PWR":3}}

{"INFO":{"RSP":"OK","CMD":"SET POWR","TS":1542231047},"SUCCESS":true,"DATA":{"F2L":7,"PWR":3,"FANLMINMAX":[0,5,0,1,0,1]}}

Thanks for the info of the lola stove forum ; it seems that we can control the rear fan with the new version : great news ! I've got 2 rear fans which send heat at the floor of my house.

Thanks, Ronando

kinou74 commented 5 years ago

Hello Ronando

Many thanks for your feedback. I've started a new branch called "compat_with_new_lua_api". Please can you give it a try ? On/Off switch, Timer switch, Power level and Room Fan level should be working. I have a doubt regarding Temperatures. For sure, the quantity of pellets will not work for the time being cause that the information is no more returned with the GET+ALLS as it was. (to be confirmed -- it should available with an additional GET+CNTR call with a lower periodicity to avoid unnecessary calls)

Would you be so kind as to attach the json results for the following commands ? GET+TMPS GET+FAND GET+STAT GET+CNTR

Merci beaucoup !

RonandoDeLaVega commented 5 years ago

Hello kinou74,

I can't make the plugin work ... But I don't have much time to try this evening. Here is the result of the results of the commands : It seems that pellet qty is PQT in GET+CNTR command ;-)

GET+TMPS : {"INFO":{"RSP":"OK","CMD":"GET TMPS","TS":1542318121},"SUCCESS":true,"DATA":{"T2":31.7,"T3":53,"T1":0,"T5":20,"T4":0}}

GET+FAND : {"INFO":{"RSP":"OK","CMD":"GET FAND","TS":1542317054},"SUCCESS":true,"DATA":{"F2L":7,"F2LF":2,"F2V":0,"F1V":0,"F1RPM":0}}

GET+STAT : {"INFO":{"RSP":"OK","CMD":"GET STAT","TS":1542317053},"SUCCESS":true,"DATA":{"STATUS":1,"LSTATUS":1}}

GET+CNTR : {"INFO":{"RSP":"OK","CMD":"GET CNTR","TS":1542317051},"SUCCESS":true,"DATA":{"IGNERRORS":0,"POWERTIME":"516:02","SERVICETIME":"228:55","PQT":226,"OVERTMPERRORS":0,"HEATTIME":"228:55","ONTIME":"00:00","IGN":43}}

Thanks, Ronando

kinou74 commented 5 years ago

My bad, I forgot to mention that you have to set the new option “use new api” to True in the hardware settings ! You can also enable the debug mode of the plugin to have more info or clues on what’s going on. And thank you for the results. I’ll have a look at them tomorrow. I’ll let you know.

kinou74 commented 5 years ago

Hi

Just found and fixed another issue with the "INFO" json key returned in upper cases with the new API while it's in capital letters in the old version. So the fix should help somehow. I'll work on pellet qty and temperatures as soon as you confirm that there is at least an interaction between the plugin and your stove.

RonandoDeLaVega commented 5 years ago

Hello,

Most of it seems to work know ! :-D

What don't work are the Power Level (data = On) and the Fan Speed (data = Off). When comparing to your screenshots, it seems that the data should be from 1 to 5 no ?

Nice work here !

Thanks, Ronando

RonandoDeLaVega commented 5 years ago

Hello,

Don't take in account the last message, I need to do more tests, it seems that on my cellphone browser it's OK.

Thanks, Ronando

RonandoDeLaVega commented 5 years ago

Hello kinou74,

After several days of test, most of it seems to work, good job !

"Off" and "Auto" button for the central fan speed looks to be interverted.

Furthermore, is it possible to add the other fans as a simple on/off switch ?

http://xxx.xxx.xxx.xxx/cgi-bin/sendmsg.lua?cmd=SET+FN3L+1

http://xxx.xxx.xxx.xxx/cgi-bin/sendmsg.lua?cmd=SET+FN4L+1

Do you have left/right fans on your pellet stove ?

Thanks, Ronando

kinou74 commented 5 years ago

Hello Ronando,

Many thanks for the feedback ! Unfortunately, my stove only has the main fan without any additional ones. So I propose to work on this new feature part of a new branch in the coming days.

For the Auto/Off fan speed issue, I'm a little confused because I follow the Palazzetti webapp code values: In the user settings page, if you have a look at the html code that is common for all stoves, you'll see that:

In the virtual Fan speed device, you should have those values (created automatically at plugin installation):

Then, in the plugin code, we translate the virtual device level with the stove fan speed level as follow when we change the device or when we receive a new value from the json result:

So it's really weird...

Can you perform some tests as follow:

Cheers Nicolas

enricomf commented 5 years ago

Hello, Is it possible to use domoticz and ur plugin without the connection box from Palazzetti? I just got the new stove and i dont know if it worth spending 120€ for it. Can i use a raspberrypi instead of the connection box? Thanks Henry

RonandoDeLaVega commented 5 years ago

Hello kinou74 !

It's been a long time since I havn't updated ...

I still didn't manage to identify how to fix my issue with the central ventilation, I have to do some more tests. However, thanks to your clean code, I've added the Left and Right Fan of the stove ; I'll clean the code and add it here.

Other question, do you use some kind of a script to regulate the stove ? like a PID ?

Thanks a lot for sharing your work !! Ronando

gfiorigithub commented 4 years ago

Dear All,

Really great job so far. This comments have been really useful. Do you by chance know which is the command to get the status of the pressostat? I would also like to force the circulating pump to start: as far as you know, is there a command for that?

Many thanks, Gianluca