Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Comfort2MQTT with Home Assistant Part 3 - Notifications
#1
Notifications
You need the Home Assistant app to be installed on Android or iOS  and enable notifications. 
First sign in to companion app on your mobile phone (iOS or android) to allow the mobile phone to be discovered by Home Assistant.
Check Mobile App Integration:
  • In Home Assistant, navigate to Settings > Devices & Services > Integrations.
  • Look for the Mobile App integration. This should automatically recognize your phone as a device.
  • This integration is by default enabled, unless you’ve disabled or removed the default_config: line from your configuration. If that is the case, the following example shows you how to enable this integration manually:

    # Example configuration.yaml entry
    mobile_app:



Go to settings   > automations & scenes     > create new automation






Press Add Trigger



select Other Triggers


select MQTT 




in Topic, chose a topic ie MQTT Topic Published (By Comfort)
  • comfort2mqtt/alarm - current MQTT Security Mode (disarmed, pending, armed_home, armed_away, armed_night, arm_vacation, triggered)
  • comfort2mqtt/alarm/online - \'1\' for online, \'0\' for offline
  • comfort2mqtt/alarm/message - Informational messages, e.g. the zone that triggered an alarm
  • comfort2mqtt/alarm/timer - countdown entry/exit timer in seconds when arming to away mode or entering. updates every second.
  • comfort2mqtt/alarm/status - Status of the alarm (Idle, Trouble, Alert, Alarm)
  • comfort2mqtt/alarm/bypass - List of Bypassed zones. EG. 1,3,5,7,9. \'0\' indicates no bypassed zones.
  • comfort2mqtt/alarm/LWT - Online or Offline text status
  • comfort2mqtt/alarm/refresh - Trigger a refresh of all objects. Used when a refresh of all object states are required.
  • comfort2mqtt/alarm/connected - Status of LAN Connection to Comfort. \'1\' when connected and logged in.
  • comfort2mqtt/alarm/doorbell - \'0\' for off/answered or \'1\' for on
  • comfort2mqtt/alarm/mode - Integer values for current Alarm Mode. 0 - 4 (Off, Away, Night, Day, Vacation), See Comfort M? or MD documentation.
Eg to select Alarm State = Alarm , enter topic = comfort2mqtt/alarm/status
Payload = Alarm
If the payload is left blank it means that any change in Alarm State will trigger the notification eg Idle, Trouble, Alert, Alarm


You can add other Triggers to this action if needed.
Select Then Do, and + Add Action



scroll down and select Notifications or enter notifications in the search  bar;


Look for Send a notification via mobile app and select the ID for the mobile device that has been added as a User
If more than 1 phone is required, add another action and select the next mobile device
Press Save



You will be asked to enter a Name for the automation, eg Comfort Alarm



Reply

#2
Other Notification triggers using MQTT Actions


Topic   
                     
  comfort2mqtt/alarm    
  Payload                       NONE
   Comments                 Any change in Security Mode


Topic
   comfort2mqtt/alarm 
   Payload         disarmed, pending, armed_home, armed_away,    armed_night, arm_vacation, triggered
  Comments     Change security Mode according to Payload 

Topic 
  comfort2mqtt/alarm/mode
  Payload        0,1,2,3
  Comments    0 = off, 1 = away, 2 = Night, 3 = Day, 4 =    Vacation (same info as    comfort2mqtt/alarm exceot numeric payload instead of name

Topic  
 comfort2mqtt/alarm/bypass[code]  
The resulting automations.yaml may look like this; - id: \'1732617452162\'
  alias: Set/Unset
  description: \'\'
  triggers:
  - trigger: state
    entity_id:
    - sensor.alarm_mode
  conditions: []
  actions:
  - action: notify.mobile_app_sm_a546e
    metadata: {}
    data:
      message: Set/Unset
  mode: single
- id: \'1732618839636\'
  alias: alarm Message
  description: \'\'
  triggers:
  - trigger: state
    entity_id:
    - sensor.alarm_message
  conditions: []
  actions:
  - action: notify.mobile_app_sm_a546e
    metadata: {}
    data:
      message: AlarmMessage
  mode: single
- id: \'1732619127853\'
  alias: System Disarmed
  description: \'\'
  triggers:
  - trigger: mqtt
    topic: comfort2mqtt/alarm
    payload: disarmed
  conditions: []
  actions:
  - action: notify.mobile_app_sm_a546e
    metadata: {}
    data:
      message: System Disamed
  - action: notify.mobile_app_sm_a736b
    metadata: {}
    data: {}
  mode: single
- id: \'1732621878860\'
  alias: System Armed
  description: \'\'
  triggers:
  - trigger: mqtt
    topic: comfort2mqtt/alarm
    payload: armed_home
  - trigger: mqtt
    topic: comfort2mqtt/alarm
    payload: armed_away
  - trigger: mqtt
    topic: comfort2mqtt/alarm
    payload: armed_night
  - trigger: mqtt
    topic: comfort2mqtt/alarm
    payload: armed_vacation
  conditions: []
  actions:
  - action: notify.mobile_app_sm_a546e
    data:
      message: System Armed
  - action: notify.mobile_app_sm_a736b
    data:
      message: System Armed
  mode: single
- id: \'1732622117164\'
  alias: Trouble
  description: \'\'
  triggers:
  - trigger: mqtt
    topic: comfort2mqtt/alarm/status
    payload: Trouble
  conditions: []
  actions:
  - action: notify.mobile_app_sm_a546e
    metadata: {}
    data:
      message: Trouble
  mode: single
- id: \'1732622180277\'
  alias: Alarm
  description: \'\'
  triggers:
  - trigger: mqtt
    topic: comfort2mqtt/alarm/status
    payload: Alarm
  conditions: []
  actions:
  - action: notify.mobile_app_sm_a546e
    metadata: {}
    data:
      message: Alarm triggered!
  - action: notify.mobile_app_sm_a736b
    metadata: {}
    data: {}
  mode: single
Reply

#3
For Remote access to the Mobile app (Companion App), you can use one of the following;
  • Port Forwarding on your router to Port 8123 of your local Home Assistant IP address. Use a dynamic DNS service eg noip.com or dyndns so you can access by a fixed URL.
  • Home Assistant Cloud which gives many more features, line connect with the Voice Assistant see https://www.nabucasa.com/ It costs a small amount paid month or yearly but has a 1 month trial period
  • Use a Virtual Private Network (VPN) 
I have tried the 1st 2 options, but not the VPN as that seems more complicated


In the Home Assistant App, you can specify several Servers eg Home, Office, Home Remote, Office Remote with different IP addresses. In the Home Assistant Companion app you can select the server in Settings > Cmpanion App (but this is not on the Desktop client)
Reply

#4
The notification on the Mobile phone is shown for system armed





The notification by SMS is also seen before that
Reply

#5
Questions and comments in http://www.comfortforums.com/forum27/5579.html as the original topics are closed
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

Powered By MyBB, © 2002-2026 Melroy van den Berg.