CyberDNS / Lupusec2Mqtt

Lupusec Alarm System to Mqtt
MIT License
11 stars 5 forks source link

can not arm the system #37

Closed mbay0r closed 1 year ago

mbay0r commented 1 year ago

Unfortunately, the buttons have no function:

Screenshot_20221217_195145

Also there are the following functions in lupus, which the addon does not map:

Area 1: Arm, Home 1, Home 2, Home 3, Disarm Area 2: Arm, Home 1, Home 2, Home 3, Disarm

This Status is not correct, because my Status on Lupus is disarmed, so it should not be "Sicher". It should called "Unsicher" or disarmed:

Screenshot_20221217_195523

CyberDNS commented 1 year ago

Are you trying this on the latest Edge version or the normal version 2.0.1? Normally both areas should work and to get all the buttons you need to activate them in the card configuration: image

mbay0r commented 1 year ago

Did not See That, sorry. But how can i rename the states? I know it is first used by you. But it should follow the designations of the lupus.

Anyway arm does Not work, im using edge Right now. Is That the Problem ?

mbay0r commented 1 year ago

Im using a xt2 plus.

CyberDNS commented 1 year ago

Here is the mapping that is done between Home Assistant and Lupusec:

Lupusec Home Assistant
Disarmed disarmed
FullArm armed_away
HomeArm1 armed_night
HomeArm2 armed_home
HomeArm3 armed_vacation

I don't know if it is possible to edit the names on the Alarm Panel Card in HA.

For the problem that you cannot set the mode, do you see something in the logs when doing the operation (when log level is set to debug)? I tested it just now on my XT2 and there it works even with the Edge version.

mbay0r commented 1 year ago

no error, nothing works. log level is still Debug

CyberDNS commented 1 year ago

Ok, what do you see in your MQTT? image

mbay0r commented 1 year ago

is that from mqtt explorer?

im using Mosquitto broker, its also set to output debug messages, but does not say anything.

CyberDNS commented 1 year ago

Yes from MQTT Explorer, there you can see the configuration of the devices and you should see at least the value being set from Home Assistant. Like in my example set = DISARM, is when I click on DISARM in HA.

mbay0r commented 1 year ago
lupusec_alarm_area2
config = {"state_topic":"homeassistant/alarm_control_panel/lupusec/lupusec_alarm_area2/state","command_topic":"homeassistant/alarm_control_panel/lupusec/lupusec_alarm_area2/set","name":"Area 2","unique_id":"lupusec_alarm_area2"}
state = disarmed
set = ARM_AWAY

is that the problem? Did you rename something in your xt2?

CyberDNS commented 1 year ago

No this look ok. It should change to set = DISARM, if you click on the disarm button in HA.

mbay0r commented 1 year ago

i cannot disarm, because its not armed.

https://github.com/CyberDNS/Lupusec2Mqtt/commit/6b72554437a86882c63669488b31951a5e3162f0

here you did write "Added vacation mode"

What is the vacation mode? i dont have that on my xt2 plus. is it HomeArm3?

CyberDNS commented 1 year ago

Yes it maps to HomeArm3.

You already restarted the Addon?

mbay0r commented 1 year ago

Yes :-(

mbay0r commented 1 year ago

ok, i did an arm over the xt2 plus.

status in HA is correct. but i cannot disarm over HA.

lupusec_alarm_area2
config = {"state_topic":"homeassistant/alarm_control_panel/lupusec/lupusec_alarm_area2/state","command_topic":"homeassistant/alarm_control_panel/lupusec/lupusec_alarm_area2/set","name":"Area 2","unique_id":"lupusec_alarm_area2"}
state = disarmed
set = DISARM
mbay0r commented 1 year ago

image

CyberDNS commented 1 year ago

And on the XT2 Plus, when you change the ARM state over the Lupusec UI, do you see an POST message in dev tools on /action/panelCondPost with area and mode as form data?

mbay0r commented 1 year ago

yes Screenshot_20221218_103812

mbay0r commented 1 year ago

Request URL: https://xxxx/action/panelCondPost

CyberDNS commented 1 year ago

But no log like this: "Area {Area} set to {Mode}", area, mode or "An error occured while setting alarm mode to Area {Area} set to {Mode}"?

Can you give it a try with the normal, non edge version?

mbay0r commented 1 year ago

No log like this.

i cannot start normal version anymore.

Image cyberdns/lupusec2mqtt_hassaddon_amd64:2.0.1 does not exist for addon_92a7574d_Lupusec2Mqtt

do i have to remove the edge before? you can not have both installed in parallel?

mbay0r commented 1 year ago

ok, i did reinstall the normal version, unfortunately also does not work

CyberDNS commented 1 year ago

Honestly I don't know anymore what I can do to help you out for the moment. But anyway, I am working on a complete rewrite of the addon due to the other issue for integrating shutters and thermostats. The current design made it more and more complicated to add new device types, so I took yesterday the decision to do a rewrite. I will add a lot more diagnostic logging informations into that version to make it easier to debug issues like the one you are encountering. Unfortunately you will have to wait until this version becomes available, I hope that I can publish a new version during the next week.

mbay0r commented 1 year ago

hi david,

wow, that sounds good, thanks for the effort! maybe you can addapt the iobroker addon or copy some of it, it really works perfectly.

Maybe you can also keep the new version more general, I can understand that you adapted it to you (active vacation), but that probably does not apply to the general public.

I will now activate the edge version again and then wait for an update. If you want me to test something, feel free to contact me.

Have a nice sunday!

CyberDNS commented 1 year ago

Yes I will keep you posted when there is something to test. Unfortunately the point with active vacation is not coming from my side but it is implemented like this in HA. I did a quick search and I did not find how to customize those text in HA.

CyberDNS commented 1 year ago

I published a new version 3.0.0 in the edge lane, there you can see now more messages when something is changing-

Cover/Shutter is not yet included, it is pure refactoring of what was already there.

[15:18:04 INF] Value for topic homeassistant/binary_sensor/lupusec/RF_01a99f10/state changed from OFF to ON {"SourceContext": "Lupusec2Mqtt.MainLoop"}
[15:18:08 INF] Value for topic homeassistant/binary_sensor/lupusec/RF_01a99f10/state changed from ON to OFF {"SourceContext": "Lupusec2Mqtt.MainLoop"}
[15:18:12 INF] Polling... (Every 5th cycle is logged) {"SourceContext": "Lupusec2Mqtt.MainLoop"}
[15:18:22 INF] Polling... (Every 5th cycle is logged) {"SourceContext": "Lupusec2Mqtt.MainLoop"}
[15:18:32 INF] Polling... (Every 5th cycle is logged) {"SourceContext": "Lupusec2Mqtt.MainLoop"}
[15:18:35 INF] Value for topic homeassistant/sensor/lupusec/ZS_25d301_power/state changed from 7.8 to 0.0 {"SourceContext": "Lupusec2Mqtt.MainLoop"}
[15:18:36 INF] Value for topic homeassistant/switch/lupusec/ZS_25d301/state changed from ON to OFF {"SourceContext": "Lupusec2Mqtt.MainLoop"}
[15:18:42 INF] Polling... (Every 5th cycle is logged) {"SourceContext": "Lupusec2Mqtt.MainLoop"}
[15:18:46 INF] Value for topic homeassistant/switch/lupusec/ZS_25d301/state changed from OFF to ON {"SourceContext": "Lupusec2Mqtt.MainLoop"}
[15:18:52 INF] Polling... (Every 5th cycle is logged) {"SourceContext": "Lupusec2Mqtt.MainLoop"}
[15:18:54 INF] Value for topic homeassistant/sensor/lupusec/ZS_25d301_power/state changed from 0.0 to 8.1 {"SourceContext": "Lupusec2Mqtt.MainLoop"}
[15:18:55 INF] Area 2 set to ARM_HOME {"SourceContext": "Lupusec2Mqtt.MainLoop"}
[15:18:57 INF] Value for topic homeassistant/alarm_control_panel/lupusec/lupusec_alarm_area2/state changed from disarmed to armed_home {"SourceContext": "Lupusec2Mqtt.MainLoop"}
[15:19:02 INF] Polling... (Every 5th cycle is logged) {"SourceContext": "Lupusec2Mqtt.MainLoop"}
[15:19:03 INF] Area 2 set to DISARM {"SourceContext": "Lupusec2Mqtt.MainLoop"}
[15:19:05 INF] Value for topic homeassistant/alarm_control_panel/lupusec/lupusec_alarm_area2/state changed from armed_home to disarmed {"SourceContext": "Lupusec2Mqtt.MainLoop"}
[15:19:12 INF] Polling... (Every 5th cycle is logged) {"SourceContext": "Lupusec2Mqtt.MainLoop"}
mbay0r commented 1 year ago
[21:00:43 DBG] Querying values for lupusec_alarm_area1 - Area 1 on topic homeassistant/alarm_control_panel/lupusec/lupusec_alarm_area1/state => disarmed {"SourceContext": "Lupusec2Mqtt.MainLoop"}
[21:00:43 DBG] Querying values for lupusec_alarm_area2 - Area 2 on topic homeassistant/alarm_control_panel/lupusec/lupusec_alarm_area2/state => disarmed {"SourceContext": "Lupusec2Mqtt.MainLoop"}
[21:00:43 DBG] Querying values for lupusec_alarm_area1_alarm_status - Area 1 Alarm Status on topic homeassistant/binary_sensor/lupusec/lupusec_alarm_area1_alarm_status/state => OFF {"SourceContext": "Lupusec2Mqtt.MainLoop"}
[21:00:43 DBG] Querying values for lupusec_alarm_area2_alarm_status - Area 2 Alarm Status on topic homeassistant/binary_sensor/lupusec/lupusec_alarm_area2_alarm_status/state => OFF {"SourceContext": "Lupusec2Mqtt.MainLoop"}
CyberDNS commented 1 year ago

Hi again,

I pushed a new version 3.0.3 (edge) with even more logging and an updated MQTT library. Could you check if the problem is still there and investigate the logs:

mbay0r commented 1 year ago

Hey, thanks for the Update Arm still does Not work.

14:53:30 DBG] This was the Answer for requesting https://192.168.x.x/action/panelCondGet: Lupusec2Mqtt.Lupusec.Dtos.PanelCondition [14:53:30 DBG] Querying values for lupusec_alarm_area1 - Area 1 on topic homeassistant/alarm_control_panel/lupusec/lupusec_alarm_area1/state => disarmed [14:53:30 DBG] Querying values for lupusec_alarm_area2 - Area 2 on topic homeassistant/alarm_control_panel/lupusec/lupusec_alarm_area2/state => disarmed [14:53:30 DBG] Querying values for lupusec_alarm_area1_alarm_status - Area 1 Alarm Status on topic homeassistant/binary_sensor/lupusec/lupusec_alarm_area1_alarm_status/state => OFF [14:53:30 DBG] Querying values for lupusec_alarm_area2_alarm_status - Area 2 Alarm Status on topic homeassistant/binary_sensor/lupusec/lupusec_alarm_area2_alarm_status/state => OFF

Frohe Weihnachten!

CyberDNS commented 1 year ago

Ok and on startup you see the registration messages? (Probably it is better to have the Log Level set to Information to start with, otherwise the log buffer risks to push the relevant messages out of the log console)

And you should see some logs when arm or disarm is hit.

Dir auch frohe Weihnachten!

mbay0r commented 1 year ago
Homeassistant config file path is /data/options.json
[15:40:37 INF] Lupusec2Mqtt is starting up...
[15:40:54 INF] Command homeassistant/alarm_control_panel/lupusec/lupusec_alarm_area1/set registered for device lupusec_alarm_area1 - Area 1
[15:40:54 INF] Device configured: lupusec_alarm_area1 - Area 1
[15:40:54 INF] Command homeassistant/alarm_control_panel/lupusec/lupusec_alarm_area2/set registered for device lupusec_alarm_area2 - Area 2
[15:40:54 INF] Device configured: lupusec_alarm_area2 - Area 2
[15:40:54 INF] Device configured: lupusec_alarm_area1_alarm_status - Area 1 Alarm Status
[15:40:54 INF] Device configured: lupusec_alarm_area2_alarm_status - Area 2 Alarm Status
[16:43:59 INF] Area 1 set to ARM_AWAY
[16:43:59 INF] Command homeassistant/alarm_control_panel/lupusec/lupusec_alarm_area1/set of device lupusec_alarm_area1 - Area 1 executed with input ARM_AWAY
[16:43:59 INF] Area 2 set to ARM_AWAY
[16:43:59 INF] Command homeassistant/alarm_control_panel/lupusec/lupusec_alarm_area2/set of device lupusec_alarm_area2 - Area 2 executed with input ARM_AWAY
[16:44:27 INF] Area 1 set to ARM_HOME
[16:44:27 INF] Command homeassistant/alarm_control_panel/lupusec/lupusec_alarm_area1/set of device lupusec_alarm_area1 - Area 1 executed with input ARM_HOME
[16:44:28 INF] Area 2 set to ARM_HOME
[16:44:28 INF] Command homeassistant/alarm_control_panel/lupusec/lupusec_alarm_area2/set of device lupusec_alarm_area2 - Area 2 executed with input ARM_HOME
CyberDNS commented 1 year ago

Ok, can you upgrade to version 3.0.4, then set the MinimumLevel to Debug and then redo the operations to arm and disarm the alarm, and provide me the logs. You should see something like this:

[07:58:48 INF] Area 2 set to ARM_HOME
[07:58:48 DBG] Response for POST http://192.168.2.60/action/panelCondPost:
Request:
Method: POST, RequestUri: 'http://192.168.2.60/action/panelCondPost', Version: 1.1, Content: System.Net.Http.FormUrlEncodedContent, Headers:
{
  Accept: application/json
  Authorization: Basic *****=
  X-Token: *****
  Content-Type: application/x-www-form-urlencoded
  Content-Length: 13
}
Response:
StatusCode: 200, ReasonPhrase: 'OK', Version: 1.0, Content: System.Net.Http.HttpConnectionResponseContent, Headers:
{
  Server: Mongoose
  Pragma: no-cache
  Cache-Control: no-cache
  Expires: 0
  Content-Type: application/json; charset=utf-8
  Content-Length: 61
}
Response body:
RESULT_CODE: 1 MESSAGE: {WEB_MSG_SUBMIT_SUCCESS}
[07:58:48 INF] Command homeassistant/alarm_control_panel/lupusec/lupusec_alarm_area2/set of device lupusec_alarm_area2 - Area 2 executed with input ARM_HOME
[07:58:49 INF] Value for topic homeassistant/alarm_control_panel/lupusec/lupusec_alarm_area2/state on device lupusec_alarm_area2 - Area 2 changed from disarmed to armed_home
[07:58:56 INF] Area 2 set to DISARM
[07:58:56 DBG] Response for POST http://192.168.2.60/action/panelCondPost:
Request:
Method: POST, RequestUri: 'http://192.168.2.60/action/panelCondPost', Version: 1.1, Content: System.Net.Http.FormUrlEncodedContent, Headers:
{
  Accept: application/json
  Authorization: Basic *****=
  X-Token: *****
  Content-Type: application/x-www-form-urlencoded
  Content-Length: 13
}
Response:
StatusCode: 200, ReasonPhrase: 'OK', Version: 1.0, Content: System.Net.Http.HttpConnectionResponseContent, Headers:
{
  Server: Mongoose
  Pragma: no-cache
  Cache-Control: no-cache
  Expires: 0
  Content-Type: application/json; charset=utf-8
  Content-Length: 61
}
Response body:
RESULT_CODE: 1 MESSAGE: {WEB_MSG_SUBMIT_SUCCESS}
[07:58:56 INF] Command homeassistant/alarm_control_panel/lupusec/lupusec_alarm_area2/set of device lupusec_alarm_area2 - Area 2 executed with input DISARM
[07:58:57 INF] Value for topic homeassistant/alarm_control_panel/lupusec/lupusec_alarm_area2/state on device lupusec_alarm_area2 - Area 2 changed from armed_home to disarmed
mbay0r commented 1 year ago

That was very useful, it works now.

RESULT_CODE: 0 MESSAGE: {WEB_ERR_FORBIDDEN} I'm almost a little embarrassed, but the user I configured had no rights to arm the system. :-( but the shutters do not work with it yet

I am sorry.

CyberDNS commented 1 year ago

No problem for that, the logging code will help in the future to debug such problems 😉.

Yes, shutter is not yet integrated in the refactored code, I will work on this during next days, I will keep you informed.