diff --git a/HMI/README.md b/HMI/README.md index a5461145..6058d75b 100644 --- a/HMI/README.md +++ b/HMI/README.md @@ -57,19 +57,19 @@ The following message can be used to update the content on the cardEntities Page entityUpdHeading,heading1337 -entityUpd,*id*,*iconId*,*nameOfEntity*,*type*,*optionalValue* +entityUpd,*id*,*type*,*internalNameEntity*,*iconId*,*displayNameEntity*,*optionalValue* -entityUpd,1,1,Light1,light,0 +entityUpd,1,light,light.entityName,1,Light1,0 -entityUpd,2,0,Shutter2,shutter +entityUpd,2,shutter,cover.entityName,0,Shutter2 -entityUpd,3,0,dc,delete +entityUpd,3,delete -entityUpd,4,3,Temperature,text,content +entityUpd,4,text,sensor.entityName,3,Temperature,content -entityUpd,4,3,bt-name,button,bt-text +entityUpd,4,button,button.entityName,3,bt-name,bt-text -entityUpd,1,4,Switch1,switch,0 +entityUpd,1,switch,switch.entityName,4,Switch1,0 ### popupLight Page diff --git a/HMI/nspanel.HMI b/HMI/nspanel.HMI index 9341874a..adbd7076 100644 Binary files a/HMI/nspanel.HMI and b/HMI/nspanel.HMI differ diff --git a/HMI/nspanel.tft b/HMI/nspanel.tft index db28795a..a6acc1ec 100644 Binary files a/HMI/nspanel.tft and b/HMI/nspanel.tft differ diff --git a/appdaemon/apps/nspanel.py b/appdaemon/apps/nspanel.py index c25b729e..9e4b7ebe 100644 --- a/appdaemon/apps/nspanel.py +++ b/appdaemon/apps/nspanel.py @@ -105,22 +105,21 @@ class NsPanelLovelanceUI: self.api.log("generating item command for %s with type %s", item, item_type) if item_type == "delete": - return "entityUpd,{0},{1},{2},{3}".format(item_nr, 0, "dc", item_type) + return "entityUpd,{0},{1}".format(item_nr, item_type) - entity = self.api.get_entity(item) name = entity.attributes.friendly_name if item_type == "cover": - return "entityUpd,{0},{1},{2},{3}".format(item_nr, 0, name, "shutter") # TODO: shutter should be renamed to cover in the nextion project + return "entityUpd,{0},{1},{2},{3},{4}".format(item_nr, "shutter", item, 0, name) # TODO: shutter should be renamed to cover in the nextion project if item_type == "light": switch_val = 1 if entity.state == "on" else 0 - return "entityUpd,{0},{1},{2},{3},{4}".format(item_nr, 1, name, item_type, switch_val) + return "entityUpd,{0},{1},{2},{3},{4},{5}".format(item_nr, item_type, item, 1, name, switch_val) if item_type == "switch": switch_val = 1 if entity.state == "on" else 0 - return "entityUpd,{0},{1},{2},{3},{4}".format(item_nr, 4, name, item_type, switch_val) + return "entityUpd,{0},{1},{2},{3},{4},{5}".format(item_nr, item_type, item, 4, name, switch_val) if item_type == "sensor": icon_id = 0 @@ -129,10 +128,10 @@ class NsPanelLovelanceUI: }[entity.attributes.device_class] value = entity.state + " " + entity.attributes.unit_of_measurement - return "entityUpd,{0},{1},{2},{3},{4}".format(item_nr, icon_id, name, "text", value) + return "entityUpd,{0},{1},{2},{3},{4},{5}".format(item_nr, "text", item, icon_id, name, value) if item_type == "button": - return "entityUpd,{0},{1},{2},{3},{4}".format(item_nr, 3, name, item_type, "PRESS") + return "entityUpd,{0},{1},{2},{3},{4},{5}".format(item_nr, item_type, item, 3, name, "PRESS") def generate_thermo_page(self, item): entity = self.api.get_entity(item)