Files
NSPanel_HA_Blueprint/nspanel_us_code/cover.txt
Edward Firmo f25ca0934c Embedded climate (#917)
* Performance improvements

The main focus here was to reduce the number of calls between Home Assistant and ESPHome, moving logic as much as possible to TFT and ESPHome.
- Service calls moved to ESPHome (in preparation for Alarm Control Panel)
- Page change informed via event call instead of `nspanel_event` sensor (which still in use by other calls, but might be possible to remove in the future)

* Draft embedded climate

This adds an initial version of an embedded climate/thermostat (heating only for now) with support for local control even with Wi-Fi out.

Solves #646
Solves #263

* Update ReleaseNotes.md

* Fix climate slider

Fix for climate slider opening in an incorrect position and sending only the integer part of the new target temperature

* Moving home page to ESPHome

In progress...

* Fix translations - Dutch

* Embedded chip 3

Home page - Chip 3 will be controlled locally when embedded climate is enable.

* Fixed buttons bar

Fixed buttons bar managed on ESPHome when embedded climate is visible.
2023-07-08 09:34:09 +02:00

295 lines
8.3 KiB
Plaintext

Page cover
Attributes
ID : 0
Scope : local
Dragging : 0
Send Component ID : disabled
Locked : no
Swide up page ID : disabled
Swide down page ID : disabled
Swide left page ID : disabled
Swide right page ID: disabled
Events
Preinitialize Event
dim=home.brightness.val
if(home.api.val==0)
{
page home
}else
{
coversetting.txt="{\"page\": \"cover\", \"component\": \"currentpage\", \"value\": \"pagechange\", \"entity\": \""+home.entity.txt+"\"}"
printh 92
prints "nspanelevent",0
printh 00
prints coversetting.txt,0
printh 00
printh FF FF FF
page_label.txt=home.entity.txt
}
Touch Press Event
coversetting.txt="{\"page\": \"cover\", \"component\": \"touchevent\", \"value\": \"press\", \"entity\": \""+home.entity.txt+"\"}"
printh 92
prints "touchevent",0
printh 00
prints coversetting.txt,0
printh 00
printh FF FF FF
Touch Release Event
coversetting.txt="{\"page\": \"cover\", \"component\": \"touchevent\", \"value\": \"release\", \"entity\": \""+home.entity.txt+"\"}"
printh 92
prints "touchevent",0
printh 00
prints coversetting.txt,0
printh 00
printh FF FF FF
Page Exit Event
home.entity.txt=""
Variable (string) va1
Attributes
ID : 9
Scope : local
Text : newtxt
Max. Text Size: 10
Variable (string) coversetting
Attributes
ID : 15
Scope : local
Text :
Max. Text Size: 255
Variable (string) back_page
Attributes
ID : 16
Scope : local
Text : home
Max. Text Size: 15
Text battery_value
Attributes
ID : 1
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 10
Text cover_value
Attributes
ID : 2
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 10
Text page_label
Attributes
ID : 3
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 25
Text icon_state
Attributes
ID : 13
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 10
Text battery_icon
Attributes
ID : 14
Scope : local
Dragging : 0
Send Component ID : disabled
Associated Keyboard: none
Text :
Max. Text Size : 10
Picture cover_exit
Attributes
ID : 11
Scope : local
Dragging : 0
Send Component ID: disabled
Slider coverslider
Attributes
ID : 6
Scope : local
Dragging : 0
Send Component ID: disabled
Position : 0
Upper range limit: 100
Lower range limit: 0
Events
Touch Release Event
covx coverslider.val,va1.txt,0,0
cover_value.txt=va1.txt+"%"
coversetting.txt="{\"domain\": \"cover\", \"key\": \"position\", \"value\": "+va1.txt+", \"entity\": \""+home.entity.txt+"\"}"
printh 92
prints "localevent",0
printh 00
prints coversetting.txt,0
printh 00
printh FF FF FF
Button cover_open
Attributes
ID : 4
Scope : local
Dragging : 0
Send Component ID: disabled
State : unpressed
Text :
Max. Text Size : 10
Events
Touch Press Event
coversetting.txt="{\"domain\": \"cover\", \"key\": \"open_cover\", \"value\": \"press\", \"entity\": \""+home.entity.txt+"\"}"
printh 92
prints "localevent",0
printh 00
prints coversetting.txt,0
printh 00
printh FF FF FF
Button cover_close
Attributes
ID : 5
Scope : local
Dragging : 0
Send Component ID: disabled
State : unpressed
Text :
Max. Text Size : 10
Events
Touch Press Event
coversetting.txt="{\"domain\": \"cover\", \"key\": \"close_cover\", \"value\": \"press\", \"entity\": \""+home.entity.txt+"\"}"
printh 92
prints "localevent",0
printh 00
prints coversetting.txt,0
printh 00
printh FF FF FF
Button cover_stop
Attributes
ID : 10
Scope : local
Dragging : 0
Send Component ID: disabled
State : unpressed
Text :
Max. Text Size : 10
Events
Touch Press Event
coversetting.txt="{\"domain\": \"cover\", \"key\": \"stop_cover\", \"value\": \"press\", \"entity\": \""+home.entity.txt+"\"}"
printh 92
prints "localevent",0
printh 00
prints coversetting.txt,0
printh 00
printh FF FF FF
Hotspot cover_back
Attributes
ID : 12
Scope : local
Dragging : 0
Send Component ID: disabled
Events
Touch Press Event
if(back_page.txt=="buttonpage01")
{
page buttonpage01
}else if(back_page.txt=="buttonpage02")
{
page buttonpage02
}else if(back_page.txt=="buttonpage03")
{
page buttonpage03
}else if(back_page.txt=="buttonpage04")
{
page buttonpage04
}else
{
page home
}
Timer swipestore
Attributes
ID : 8
Scope : local
Period (ms): 50
Enabled : no
Events
Timer Event
swipex=tch0
swipey=tch1
TouchCap swipe
Attributes
ID : 7
Scope: local
Value: 0
Events
Touch Press Event
swipestore.en=1 // Start swipestore timer
Touch Release Event
swipestore.en=0
// Touch has ended, x
if(tch0==0)
{
swipec=swipex-tch2
// From Left to Right
if(swipec>swipedx)
{
//page
}
// Right to Left
swipec2=0-swipedx
if(swipec<swipec2)
{
//page
}
}
// Touch has ended, y
if(tch1==0)
{
swipec=swipey-tch3
// From Up to Down
if(swipec>100)
{
//page
}
// Down to Up
swipec2=0-swipedy
if(swipec<-100)
{
//page
}
}