Control your Serta bed from Home Assistant or Google, because, yes, you can be that lazy

Sometimes after a long day, you just don’t have the energy to find the remote control for your adjustable bed. I mean, that thing could be anywhere. Our Serta adjustable bed has a bluetooth connection to control it, albeit with a kind of lousy phone app. Thanks to the work of Dan Isla, the bed can be controlled using a Raspberry Pi or other device that has Bluetooth and can run Python. I use a Raspberry Pi Zero W stuck underneath the bed and even powered from one of the bed USB ports. I added an MQTT interface so that commands could be sent to it from Home Assistant (or Node-RED, etc.)

Or maybe you want to set up a sexy-time script for your SO: Turn down the lights, turn on the accent lights, start a bed massage and play Careless Whisper?

 

NHL Goal Horn Automation

 

 

My daughter has become a hockey fanatic and is slowly infecting the rest of the family, so our lives are full of hockey news, hockey stats, and hockey games.

Using JayBlackedOut’s NHL API integration, NHL games and goals are available in Home Assistant. I created a Node Red flow that watches for a goal and then activates an automated switch, along with playing the beginning of the team goal horn music, which I edited down from Youtube.

I’ve put it all into a Github repository with the Node-RED flows and the goal horn audio files.

 

 

Tracking your Chevrolet using Home Assistant, MyChevrolet and Node-RED

I came up with a sort of a kludge to create a binary sensor in Home Assistant signifying if our truck is home or not.  In the MyChevrolet app, you can configure Share Location.  If you set up a Home location, you can have the app send you a notification whenever the vehicle arrives or departs.

The Node-RED flow:

Node-RED Flow JSON
[    {        "id": "41fb480a.963748",        "type": "server-state-changed",        "z": "5e8bada2.1ce6c4",        "name": "Vehicle location",        "server": "cacdccbf.2b6e9",        "version": 1,        "exposeToHomeAssistant": false,        "haConfig": [            {                "property": "name",                "value": ""            },            {                "property": "icon",                "value": ""            }        ],
        "entityidfilter": "sensor.your_phone_last_notification",
        "entityidfiltertype": "exact",
        "outputinitially": true,
        "state_type": "str",
        "haltifstate": "",
        "halt_if_type": "str",
        "halt_if_compare": "includes",
        "outputs": 1,
        "output_only_on_state_change": true,
        "for": 0,
        "forType": "num",
        "forUnits": "minutes",
        "ignorePrevStateNull": false,
        "ignorePrevStateUnknown": false,
        "ignorePrevStateUnavailable": false,
        "ignoreCurrentStateUnknown": false,
        "ignoreCurrentStateUnavailable": false,
        "x": 244,
        "y": 226,
        "wires": [            [                "b248a35a.be4a1"            ]
        ],
        "info": "Change the Entity ID to your phone app entity for last_notification"
    },
    {
        "id": "b248a35a.be4a1",
        "type": "switch",
        "z": "5e8bada2.1ce6c4",
        "name": "MyChevrolet Location",
        "property": "payload",
        "propertyType": "msg",
        "rules": [            {                "t": "cont",                "v": "2021 Vehicle arrived at Home",                "vt": "str"            },            {                "t": "cont",                "v": "2011 Vehicle departed from Home",                "vt": "str"            }        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 551,
        "y": 225,
        "wires": [            [                "42eaff63.6ff08"            ],
            [                "58298151.bf20d"            ]
        ],
        "info": "Change \"2021 Vehicle\" to the name of your vehicle as reported by the MyChevrolet app"
    },
    {
        "id": "42eaff63.6ff08",
        "type": "change",
        "z": "5e8bada2.1ce6c4",
        "name": "Vehicle arrived home",
        "rules": [            {                "t": "set",                "p": "payload",                "pt": "msg",                "to": "true",                "tot": "bool"            }        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 857,
        "y": 200,
        "wires": [            [                "dcc47b41.2b3ac8"            ]
        ]
    },
    {
        "id": "58298151.bf20d",
        "type": "change",
        "z": "5e8bada2.1ce6c4",
        "name": "Vehicle departed home",
        "rules": [            {                "t": "set",                "p": "payload",                "pt": "msg",                "to": "false",                "tot": "bool"            }        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 850,
        "y": 269,
        "wires": [            [                "dcc47b41.2b3ac8"            ]
        ]
    },
    {
        "id": "590d1a88.43c664",
        "type": "inject",
        "z": "5e8bada2.1ce6c4",
        "name": "Inject Arrived",
        "props": [            {                "p": "payload"            },            {                "p": "topic",                "vt": "str"            }        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "Vehicle arrived at Home",
        "payloadType": "str",
        "x": 252,
        "y": 300,
        "wires": [            [                "b248a35a.be4a1"            ]
        ]
    },
    {
        "id": "254aa049.b72b9",
        "type": "inject",
        "z": "5e8bada2.1ce6c4",
        "name": "Inject Departed",
        "props": [            {                "p": "payload"            },            {                "p": "topic",                "vt": "str"            }        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "Vehicle departed from Home",
        "payloadType": "str",
        "x": 240,
        "y": 360,
        "wires": [            [                "b248a35a.be4a1"            ]
        ]
    },
    {
        "id": "dcc47b41.2b3ac8",
        "type": "ha-entity",
        "z": "5e8bada2.1ce6c4",
        "name": "Vehicle at Home",
        "server": "cacdccbf.2b6e9",
        "version": 1,
        "debugenabled": true,
        "outputs": 1,
        "entityType": "binary_sensor",
        "config": [            {                "property": "name",                "value": "vehicle_at_home"            },            {                "property": "device_class",                "value": "presence"            },            {                "property": "icon",                "value": "mdi:truck"            },            {                "property": "unit_of_measurement",                "value": ""            }        ],
        "state": "payload",
        "stateType": "msg",
        "attributes": [],
        "resend": true,
        "outputLocation": "",
        "outputLocationType": "none",
        "inputOverride": "allow",
        "outputOnStateChange": false,
        "outputPayload": "$entity().state ? \"on\": \"off\"",
        "outputPayloadType": "jsonata",
        "x": 1090,
        "y": 229,
        "wires": [            []
        ],
        "info": "Change the \"HA Config\" name to what you want the binary_sensor entity id to be."
    },
    {
        "id": "cacdccbf.2b6e9",
        "type": "server",
        "name": "Home Assistant",
        "legacy": false,
        "rejectUnauthorizedCerts": true,
        "ha_boolean": "y|yes|true|on|home|open",
        "connectionDelay": true,
        "cacheJson": true
    }
]

First up, configure your Home Assistant app to expose the Last Notification sensor.  Under App Configuration, select Manage Sensors and make sure Last Notification is enabled

Then, in the MyChevrolet App, click on Vehicle Locate: Share Location. Then click on Set Up Alerts and set up a location for Home, making sure to enable Notify Me

Finally, import the Node-Red flow.  Before deploying, edit  the vehicle name and especially the HA Config name in the entity.

After that, you should have a binary sensor in Home Assistant that updates whenever the MyChevrolet app sends a notification about arriving or departing home. There is usually a delay, and occasionally it does not update, but it’s kind of cool!

MyChevrolet app on the Google Play Store

 

Hello world!

Welcome to Stray Neutrino, my personal site for documenting my home automation setup. It’s primarily based upon Home Assistant with a big helping of Node-RED.

NeutrinoThe origin of the domain Stray Neutrino dates back to the explosion of the Internet.  I worked for an ISP/telephone company who was trying to rapidly grow as people threw money at the internet.  While we started out running Red Hat Linux, we now had to be more “professional,” and that meant running Sun Servers.  So we begrudgingly started converting. We were also at the point in the management cycle where all the IT magazines said you needed to centralize all your resources instead of have them distributed.  This seemed to flip every year or so.  Anyway, after switching to virtually all Sun servers, mostly E420Rs and Netras (or “Nectars” as our CTO called them,) things started to crash.  And I don’t mean just  a process failing, but the servers, randomly, but mostly in the middle of the night, would grind to a halt with unrecoverable memory errors.  Our consultants, of which there was an endless supply of people who could barely spell IT, came to the only possible conclusion: Our data room was dirty with sub-atomic particles, specifically Neutrinos, which were flooding the room and causing the memory errors.  My suggestion was to ask CERN if maybe they wanted to swap locations, seeing as they were searching for neutrinos and we seemed to have a plethora, but the CTO didn’t take my suggestion seriously. I had really been looking forward to meeting Tim Berners-Lee, too.