Home Assistant : Q&A, Tips & Tricks, Your Configs

xrapidx

Honorary Master
Joined
Feb 16, 2007
Messages
40,308
you could leave the remote in the car, i highly doubt that pushing a button within arms reach is easier than using your phone.
The actual use case says otherwise? When I'm 200m from the house I get a popup with options to disarm all or part of the alarm, open the garage, open the side door, etc.

Besides, I'm not leaving the remote in the car - if someone breaks in while parked in the driveway, they'll quickly discover they have access to the house.
 

MidnightZA

Expert Member
Joined
Mar 9, 2013
Messages
2,452
Not sure if its changed - but you first have to create a chat bot, then create a Telegram group with yourself and the bot - get the ChatIDs for the bot and yourself - and get the Group ID - authorise those in HA - and then you'll be able to capture and process the chat commands.

I got the bot set up already for notifications for Arm/Disarm and I also get zone triggered notificatons if my alarm is ever triggered.
I didn't know about the "telegram_command" event type. I will fiddle around with that one of the days to see what else I can do with that command
 

xrapidx

Honorary Master
Joined
Feb 16, 2007
Messages
40,308
I got the bot set up already for notifications for Arm/Disarm and I also get zone triggered notificatons if my alarm is ever triggered.
I didn't know about the "telegram_command" event type. I will fiddle around with that one of the days to see what else I can do with that command
You'd have something like this:

Code:
- alias: Alarm - Status Change
  initial_state: true
  trigger:
    - platform: state
      entity_id: binary_sensor.alarms_disarmed
      to: 'on'
  action:
    - service: notify.telegram_HA
      data_template:
        message: >
          Alarms are disarmed
        data:
          inline_keyboard:
           - 'Full Arm:/ArmFull'
           - 'Stay Arm:/ArmStay'
           - 'Sleep Arm:/ArmSleep'

Then the response would work something like this:
Code:
- alias: Alarm - Telegram - Stay Arm
  initial_state: true
  trigger:
    - platform: event
      event_type: telegram_callback
      event_data:
        data: '/ArmStay'
    - platform: event
      event_type: telegram_command
      event_data:
        command: '/ArmStay'
  action:
    - service: switch.turn_on
      entity_id: switch.stay_arm
    - service: telegram_bot.send_message
      data_template:
        target: -307610450 
        message: >
          ...stay arm command received...
 

crashy

Well-Known Member
Joined
Apr 25, 2014
Messages
113
I'm also still learning this tinkering thing. I managed to successfully hook the alarm up to Home Assistant, and it now sends me telegram messages when it triggers indicating which zone has triggered, as well as being able to arm / disarm via telegram commands. I'd like to set up a button on Lovelace to bypass certain zones and then arm, but it's here where I need some assistance. I'm thinking the button press would serve as the trigger, with the bypass commands sent as an action, followed by the arm command. I've managed to test the bypass command via developer tools so I know that works, it's just getting it to activate via a lovelace button press. Any suggestions?
Can you just re-explain here what you're wanting on LoveLace. I think I did this on mine

See this post in this thread - https://mybroadband.co.za/forum/thr...ks-your-configs.1059800/page-54#post-27319293
 

ItherNiT

Senior Member
Joined
Jan 31, 2011
Messages
962
Busy getting quotes for installing neutrals in all my light switches. While I'm at it I'm strongly considering getting whole house inverter (solar can come a bit later). Running 2 inverter trollies at the moment, with the whole house lights connected to one of them.
 

Veroland

Executive Member
Joined
Aug 24, 2005
Messages
6,304
Busy getting quotes for installing neutrals in all my light switches. While I'm at it I'm strongly considering getting whole house inverter (solar can come a bit later). Running 2 inverter trollies at the moment, with the whole house lights connected to one of them.

Out of interest, would you mind sharing what they ask to install neutrals?
 

ItherNiT

Senior Member
Joined
Jan 31, 2011
Messages
962
Out of interest, would you mind sharing what they ask to install neutrals?
Will do, 2 of them where already here, just waiting for them to email me the quotes. 2 More coming tomorrow and a solar only company next week.
 

xrapidx

Honorary Master
Joined
Feb 16, 2007
Messages
40,308
I'd like to get the temperature at a specific time of the day in the future. e.g two sensors, one with today's expected 6pm temperature - and another with tomorrow's 6pm temperature.

Anyone done something similiar so I don't heave to re-invent the wheel?
 

Veroland

Executive Member
Joined
Aug 24, 2005
Messages
6,304
I'd like to get the temperature at a specific time of the day in the future. e.g two sensors, one with today's expected 6pm temperature - and another with tomorrow's 6pm temperature.

Anyone done something similiar so I don't heave to re-invent the wheel?
Nope. But it does sound like a job for Node-Red.

I use it to read from Inlfux and update a HA entity.
I have a Inject Node that triggers every x minutes, calls a node to excecute a query, then update a entoty node. HA then displays the entity node.
 

furpile

Expert Member
Joined
Jul 14, 2014
Messages
4,283
I'd like to get the temperature at a specific time of the day in the future. e.g two sensors, one with today's expected 6pm temperature - and another with tomorrow's 6pm temperature.

Anyone done something similiar so I don't heave to re-invent the wheel?
How would you determine tomorrow's temperature? From weather forecast and historic data?
 

xrapidx

Honorary Master
Joined
Feb 16, 2007
Messages
40,308
How would you determine tomorrow's temperature? From weather forecast and historic data?
Hourly weather forecasts?

I see it is already available in HA. weather.home_hourly - only 24 hours though - but I can work with that.
 

furpile

Expert Member
Joined
Jul 14, 2014
Messages
4,283
Hourly weather forecasts?

I see it is already available in HA. weather.home_hourly - only 24 hours though - but I can work with that.
Interesting, did not know about this. I see my hourly entity was disabled, enabled it now.

Looks like you can specify a time to get a forecast from here:
 

xrapidx

Honorary Master
Joined
Feb 16, 2007
Messages
40,308
Here is my hacky way to achieve what I wanted
Code:
    temperature_at_6pm_today:
      friendly_name: "Temperature at 6pm today"
      value_template: "{%- for forecasts in  states.weather.home_hourly.attributes.forecast  -%}
                      {% set hour = ((as_timestamp(forecasts.datetime) | timestamp_custom('%H')) | int)  %}
                      {% set day = ((as_timestamp(forecasts.datetime) | timestamp_custom('%d')) | int)  %}
                      {% set today = ((as_timestamp(now()) | timestamp_custom('%d')) | int)  %}
                      {% if day == today and hour == 18 %}
                      {{ (forecasts.temperature  | float)}}
                      {% endif %}
                      {%- endfor %}"
      unit_of_measurement: 'C'
 

ItherNiT

Senior Member
Joined
Jan 31, 2011
Messages
962
For all the people running telegram for notifications, have you tried the built in HA notifications?

 

furpile

Expert Member
Joined
Jul 14, 2014
Messages
4,283
For all the people running telegram for notifications, have you tried the built in HA notifications?

I use the HA notifications for some things, but using Telegram now to send camera photos when motion is detected. Cannot send the photos with HA because I use it on my local network only and it needs internet access to send photos.
 

crashy

Well-Known Member
Joined
Apr 25, 2014
Messages
113
For all the people running telegram for notifications, have you tried the built in HA notifications?

I use a combination of both.

Basically the problem with the HA notifications is you can't get back to them as a list, where on Telegram you can access your chat to see the log
 

Speedster

Honorary Master
Joined
May 2, 2006
Messages
21,675
I use a combination of both.

Basically the problem with the HA notifications is you can't get back to them as a list, where on Telegram you can access your chat to see the log
Haven't played too much with HA notifications, but I like that telegram allows prepared responses I can simply tap on (for example to disarm / re-arm the alarm if it is triggered
 
Top