Sonoff S31 Smart Plug with Energy Monitoring

August 17th, 2021

I have been after an energy monitoring solution like the S31 provides for years.  The smart switch is actually not a need as my use cases (TV's, Lights) generally have IR commands to toggle power.  There are a couple of setup options that make this work best for me in my home automation cases:

First - load Tasmota on the S31

Enable auto discovery: SetOption19 1

Set the Power Delta value to force a MQTT update on power change:  PowerDelta 10

In Home Assistant, create a template in configuration.yaml

  - platform: template
    switches:
      living_room_tv:
        unique_id: "12833912801831"
        friendly_name: "Living Room TV"
        value_template: "{{ states('sensor.s3102_energy_power')|float > 1 }}"
        turn_on:
          - service: rest_command.ircontroller02
            data:
              ir_data:
                - data: E0E040BF
                  type: Samsung
                  length: '32'
        turn_off:
          - service: rest_command.ircontroller02
            data:
              ir_data:
                - data: E0E040BF
                  type: Samsung
                  length: '32'
 
And add any automations in automations.yaml
 
- id: '8349207385890'
  alias: Turn Off Living Room TV When Idle
  trigger:
    platform: numeric_state
    entity_id: sensor.s3102_energy_power
    below: 130
    for:
      minutes: 10
  condition:
    - condition: state
      entity_id: switch.living_room_tv
      state: 'on'
  action:
    - service: switch.turn_off
      entity_id: switch.living_room_tv
 
Here are related links:
 

IR Blaster

May 27th, 2021

I have a number of WiFi to IR "blasters" in the house (Z-Motes).  They work, but they aren't super cheap (actually not too bad but they are shipped from India I believe so the shipping plus the base cost adds up).  I would like a cheaper alternative as I have additional locations I would like to deploy these units.  I recently found an article on adding a D1 Mini and IR Shield to a TV to allow it to be controlled remotely from HTTP calls.  I initially looked into the Arduino software from this project, acquired some D1 Minis and IR Shields as well as ordered some NodeMCU circuit boards with multiple IR emitters.  Ultimately, the width of the IR beam wasn't wide enough to be suitable, but I continued to search for a good enclosure in any case.  I ended up finding an IR Blaster on eBay, intending on gutting it and just using the case for my own board, however, when it showed up, it turns out that the IR Blaster was based on an ESP8266 chip which I was able to flash with the open source IR software I had settled on.  This provided for an extremely cost effective and very powerful device.  The following links are all the related IR sites I discovered as I worked through this project.

Controlling Devices With IR Remote!
ESP8266-MQTT-IR-Blaster
ESP8266-HTTP-IR-Blaster
ESP8266 IR blaster
ESP8266 NodeMCU
IR Controller Tutorial
Super-bright 5mm IR LED - 940nm
N-channel power MOSFET - 30V / 60A
Internet of Things Infrared Remote
Built-in MQTT IR remote
Building WiFi IR remote control for any TV with ESP8266 Wemos D1 mini and ESPHome
IR code reader with ESP8266 Wemos D1 mini and ESPHome

How to Pair Android Wear Watches to New Phones without Factory Resetting

May 24th, 2021

Home Assistant Migration from Raspberry Pi to Nuc

May 24th, 2021

While my Home Assistant is running OK on my Raspberry Pi, I really want to be able to run the Visual Studio Code app and it only runs on x86 architecture.  Additionally, it would be nice to have a little more power behind HA.  I acquired an Intel Atom based NUC to keep the power requirements down so it's not a huge performance improvement but that combined with a SSD rather than a CF card and a bit more memory do make for some speed improvements. 

Install Home Assistant on an Intel NUC
Home Assistant - Intel NUC
A successful migration from Pi 3 to Intel NUC

SetDefaultBrowser - Set Windows Default Browser

May 24th, 2021

On my work computer, there seems to be a Windows policy that sets my default browser to Internet Explorer on bootup.  Since Internet Explorer doesn't work for many of the applications I support, this is a silly policy and wastes my time as I either need to set the default browser to Chrome every boot or copy past URL's instead of clicking them.  This program allows me to override the policy and set the browser the way *I* want it on every boot to counter the Windows policy.