Git Product home page Git Product logo

Comments (16)

jakezp avatar jakezp commented on May 14, 2024

Made some changes...
#51
#52

from pai.

jakezp avatar jakezp commented on May 14, 2024

Will test home assistant changes later today and confirm.

from pai.

jakezp avatar jakezp commented on May 14, 2024

I've been doing some testing and so far everything seems ok, apart from the incorrect armed state being reported in Home Assistant.

I have the following configured in pai.conf:

#57  MQTT Homeassistant
MQTT_HOMEASSISTANT_ENABLE = True

# Topic to use
# Defaults to paradox/states/partitions/PARTITION/current_hass
MQTT_HOMEASSISTANT_SUMMARY_TOPIC = 'current_hass'

# Homeassistant states map
# Key = Paradox State
# Value = State propagated to Homeassistant
MQTT_PARTITION_HOMEASSISTANT_STATES = dict(
                             alarm='triggered',
                             stay_arm='armed_home',
                             arm='armed_away',
                             sleep_arm='armed_night',
                             disarm='disarmed')
# Homeassistant control map
# Key = Command from Homeassistant
# Value = Command sent to Panel
MQTT_PARTITION_HOMEASSISTANT_COMMANDS = dict(
                                ARM_HOME='arm_stay',
                                ARM_AWAY='arm',
                                ARM_NIGHT='arm_sleep',
                                DISARM='disarm')

Using the default configuration in Home assistant:

# Alarm panel
alarm_control_panel:
  - platform: mqtt
    state_topic: "paradox/states/partitions/Area_1/current_hass"
    command_topic: "paradox/control/partitions/Area_1"
    name: "paradox"

But for some reason whenever I use arm_stay, the state is reported as armed_away. I've not been able to test arm and arm_sleep yet.

Checking the current_hass MQTT topic after arming arm_stay:

paradox/states/partitions/Area_1/current_hass = armed_away

Not sure if I'm missing something obvious, but I've double checked the HA configuration - https://www.home-assistant.io/components/manual_mqtt/ and I dont see much to be changed on this side.

Thanks,

J

from pai.

jakezp avatar jakezp commented on May 14, 2024

Scanning through the open issues, seems I'm experiencing the same as in #61...

from pai.

jpbarraca avatar jpbarraca commented on May 14, 2024

Panels send multiple events for an arm state, and we try to guess the state. But as the order changes and events can be lost, the process can fail.

Can you present a log of the messages published to the mqtt broker when arming?

from pai.

jakezp avatar jakezp commented on May 14, 2024

Sure, do you need a full debug log? How do I send it to you? Email?

I'll try find a gap today where nobody is at home, so I can cycle through all the states (arm_home, arm_away, arm_sleep) while logging.

from pai.

jpbarraca avatar jpbarraca commented on May 14, 2024

Email or gitter. Only the log of the mqtt messages.

UPDATE:
After some tests I noticed that the arm_stay property is changed after the arm property. If this is true, the state will be armed_away as the second property will be ignored. Can you check the sequence of events?

from pai.

jooka1978 avatar jooka1978 commented on May 14, 2024

Hi,

Exactly the same issue here, is there a solution?
Thanks.
2019-05-24 00:26:14,725 - INFO - PAI.paradox.interfaces.mqtt_interface - message topic=paradox/control/partitions/Lakas, payload=ARM_HOME
2019-05-24 00:26:30,708 - WARNING - PAI.paradox.paradox - Missing property stay_arm in partition/Lakas

from pai.

jpbarraca avatar jpbarraca commented on May 14, 2024

You can ignore that warning. It is for developers only and has no impact on the system behavior.
We have to map the sequence of all changes related to the arm_* properties under arm, arm_stay, disarm, etc... Can you help?

from pai.

jooka1978 avatar jooka1978 commented on May 14, 2024

Yes, of course, just tell me what to do. I am not a ninja so explain please :-)

from pai.

jpbarraca avatar jpbarraca commented on May 14, 2024

In your scenario, subscribe to all messages sent to the partitions (mosquitto_sub), and do all transitions (disarm->arm, arm->disarm, disarm->arm_away....).
Filter the log by only considering the arm_* variables.

Example:

mosquitto_sub -h localhost -t "paradox/states/partitions/#" -v > ha.log

switch modes, waiting some time between transitions (lets, say, 30s) and annotating the timestamps.
Include an alarm trigger event.

stop mosquitto_sub
cat ha.log | grep "arm" > ha-filtered.log

Send the resulting file.

from pai.

jooka1978 avatar jooka1978 commented on May 14, 2024

ok, thanks, I will do it tonight

from pai.

jooka1978 avatar jooka1978 commented on May 14, 2024

from pai.

jooka1978 avatar jooka1978 commented on May 14, 2024

ok, I have an update. So if I do the arm_home (stay) from the paradox it shows (armed_away) in HA. I can disarm it from HA.
If I do arm_home (stay) from HA it arms the paradox and show armed_home in HA. But I can not disarm anymore from HA. Actually it disarms the panel, but in HA it doesn't update the state to disarmed.
It freezes in "armed_home" state in HA forever. If I arm the paradox panel, it arms, but the HA doesn't get the state.
Only thing I can do at this stage to delete egy mqtt db file.

from pai.

jooka1978 avatar jooka1978 commented on May 14, 2024

ok, update again.
I restarted everything: HA, PAI , Mosquitto (also deleted the db file). Since then in home assistent it never goes in "armed_home" state. If I arm from HA to "ARM_HOME" it arms the paradox to arm_stay, but in HA it goes to armed_away.

from pai.

yozik04 avatar yozik04 commented on May 14, 2024

According to @jooka1978 this one is fixed in latest dev.

from pai.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.