SHAC/MQTT/HomeAssistant recall previous level

Discussion in 'C-Bus Automation Controllers' started by ssaunders, May 1, 2022.

  1. ssaunders

    ssaunders

    Joined:
    Dec 17, 2008
    Messages:
    232
    Likes Received:
    31
    Location:
    Melbourne
    True story. Sensors are one way. The others are bi-directional because they are MQTT integrated in HASS, so any change there results in a topic publish which the SHAC is subscribed to and responds.

    I think Powerwall data direct from SHAC might be more elegant than you think. It's the way I'd do it. Just one resident script.

    If I get a moment I'll give the approach more naval gazing.
     
    Last edited: Nov 7, 2022
    ssaunders, Nov 7, 2022
    #21
  2. ssaunders

    philthedill

    Joined:
    Mar 21, 2010
    Messages:
    140
    Likes Received:
    3
    Location:
    Melbourne
    thanks for clearing that up. there have been many attempts to conquer Tesla Powerwall in HA and only recently did this integration appear - and it works. there are 2 control elements here that it is important to capture. they are "select options". covering operating mode, and backup reserve level + lots of sensors. it is called tesla_custom but I cannot locate it for some reason. there is no rush on this from my perspective now that a viable alternative is in place - thanks to you. others may be keen to see something. Note that the integration also covers Tesla cars
     
    philthedill, Nov 7, 2022
    #22
  3. ssaunders

    ssaunders

    Joined:
    Dec 17, 2008
    Messages:
    232
    Likes Received:
    31
    Location:
    Melbourne
    I haven't got one of those either. Just five BMs with engines that loudly go bang. :D I'll have a look at some LUA for you and others. Given I don't have any of this kit I might call on you for some testing if you're up for it.
     
    ssaunders, Nov 7, 2022
    #23
  4. ssaunders

    philthedill

    Joined:
    Mar 21, 2010
    Messages:
    140
    Likes Received:
    3
    Location:
    Melbourne
    happy to help if I can
     
    philthedill, Nov 7, 2022
    #24
  5. ssaunders

    vworp

    Joined:
    Aug 17, 2005
    Messages:
    18
    Likes Received:
    1
    Location:
    Stoke On Trent, UK
    Phenomenal work! I've finally gotten around to trying Home Assistant this week, so I thought I'd give your scripts a go.
    For the most part, auto discovery works really well, I do seem, to have some issues with bsensors.
    I've got a tag saved as :-
    MQTT, bsensor, pn=Landing PIR, sa=Landing,

    Which I believe should discover as a read only, on off value, but actually generates nothing.

    Log errors are:-
    * string: Warning: Read undeclared global variable "off"
    * string: Warning: Read undeclared global variable "on"
    * string: Error publishing outstanding CBus discovery topics: [string "Resident"]:633: attempt to concatenate global 'on' (a nil value)

    If I change the tag to binarysensor, the device discovers it as a dimmable light



     
    vworp, Feb 9, 2024
    #25
  6. ssaunders

    ssaunders

    Joined:
    Dec 17, 2008
    Messages:
    232
    Likes Received:
    31
    Location:
    Melbourne
    Thanks, @vworp. This is fixed and pushed as part of commit 1459706.

    The keyword for binary sensor type is "binary_sensor". I have added the type without underscore as a synonym to prevent others also falling foul of a simple missing character.
     
    Last edited: Feb 10, 2024
    ssaunders, Feb 10, 2024
    #26
  7. ssaunders

    vworp

    Joined:
    Aug 17, 2005
    Messages:
    18
    Likes Received:
    1
    Location:
    Stoke On Trent, UK
    Thanks.
    I can confirm MQTT, bsensor, pn=Landing PIR, sa=Landing, on=Motion detected, off=No motion, is discovering correctly now.
     
    vworp, Feb 10, 2024
    #27
    ssaunders likes this.
  8. ssaunders

    ssaunders

    Joined:
    Dec 17, 2008
    Messages:
    232
    Likes Received:
    31
    Location:
    Melbourne
    ssaunders, Feb 10, 2024
    #28
  9. ssaunders

    ssaunders

    Joined:
    Dec 17, 2008
    Messages:
    232
    Likes Received:
    31
    Location:
    Melbourne
    I've been thinking about this lately, Michael. How about something simple like this...

    Tag an AC object with something like the below, with "isensor" being an inbound sensor? acMqtt could subscribe to the topic and publish any changes in the user parameter/GA. Should be quite simple to implement I reckon.

    Code:
    MQTT, isensor, topic=mymadeupsensor/value
     
    ssaunders, Apr 25, 2024 at 11:38 AM
    #29
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.