peepshow-21 / ns-flash

35 stars 16 forks source link

Have I always to update the whole page? #26

Closed viper-666 closed 2 years ago

viper-666 commented 2 years ago

You gave me a example how to configure the buttons on the second page. This works fine but if I update only one button like this: nxpanel {"refresh":{"pid":10,"name":"Home","format":6,buttons:[{"bid":7,"label":"Viper","type":10,"next":12,"state":15,"icon":12}]}} It changed the icon and the naming of the button, but the button don't work any more (it doesn't go to the status page). I have to refresh all buttons to get the functionality back. And can you give me please give an example whow I set the ten status on the status page?

peepshow-21 commented 2 years ago

you might find this thread more useful that here; https://community.openhab.org/t/nxpanel-replacement-firmware-for-sonoff-nspanel/132869/61

you can send a

{"sync": {"pid": 10, buttons:[{"bid":7, "state:"1}]}

you only NEED the refresh first time open the page or where it pid is different. nxpanel only ask for refresh when needed, If it's the same pid, the nxpanel should send a sync not a refresh message, meaning all the icons and labels are fine, it just needs to know the state, so you can send the short "sync" message back

make sense?

viper-666 commented 2 years ago

I know the side you mentioned, but I don't find a answer to my question there. And I thought I have understood you but nxpanel {"sync": {"pid": 10, buttons:[{"bid":1, "state:"0}]} on the Tasmota console don't change the state of the button 1 (toggle typ 1).

peepshow-21 commented 2 years ago

bit of a typo...

{"sync": {"pid": 10, buttons:[{"bid":1, "state:"0}]}

should be ...

{"sync": {"pid": 10, "buttons":[{"bid":1,"state":0}]}}

come on Andre!!! :) :) that's basic json! 😛

viper-666 commented 2 years ago

Ok, thank you that works, what one space makes... And you are so fast with the updates of the tft file, I can't flash it in time :-) Could you please give me a example code how I can fill the status page?

peepshow-21 commented 2 years ago

Status Page; https://community.openhab.org/t/nxpanel-replacement-firmware-for-sonoff-nspanel/132869/69?u=m-home

viper-666 commented 2 years ago

Thank you 👍