Saturday, 21 September 2024

Tasmota Shelly EM

 I acquired a couple of these https://shellystore.co.uk/product/shelly-em-50a/  with extra clamps.

They are easy to setup & fairly well calibrated, I compared them against the supply meter for a few days.

But, They only provide Energy usage rather than Voltage, Current, Power factor etc, so I decided to flash them with Tasmota. https://tasmota.github.io/docs/

One of these makes it easy, a tasmotizer pcb, with a 3.3V supply onboard, runs from a USB C port on a PC, https://www.amazon.co.uk/dp/B0C15K9ZC4/ref=pe_27063361_487055811_TE_dp_2, designed & produced by RevK https://www.revk.uk/ & used with Tasmotizer software https://github.com/tasmota/tasmotizer


THESE SHOULD ONLY BE CONNECTED WHEN THE EM IS NOT CONNECTED TO MAINS POWER, DAMAGE & A SHOCK HAZARD EXISTS!

1st thing was discovering the smaller pin header has 7 pins, & the Shelly EM has only 6 sockets, easy enough to cut off the 7th, unused pin, the other end from the ground pin.

2nd, after a couple of tries, was discovering several flavours of Tasmota, the one for the EM is the 4M flash version.



Smart Plugs Tasmota

 I bought some of these, https://www.mylocalbytes.com/products/smart-plug-pm, preflashed with Tasmota, also available with ESPhome & EU style sockets, not bad at £12.50 each, they will switch 13A.


Setup straightforward, usual WiFI Hub & MQTT broker details.


They are discovered by Home Assistant, so easy to set up.



Tuesday, 17 September 2024

Bluetooth Proxy

 I have a number of these,

https://buythermopro.com/product/tp357/?srsltid=AfmBOopPAqMD8LevxJewN2nf1H35xTTa1SQUm3UZew3Ek0fzLAU5LL80

Available from Amazon.


They are cheap, reasonably accurate, BLE thermometers & humidity sensors.


They are hooked up to Home Assistant via a Thermopro integration & work well, but the odd one is right on the edge of range from the RPI4 running HA.


So, never played with ESPHome before, it integrates into Home Assistant  & offers an easy way to compile & run on an ESP32.


I had a few spare ESP32C3 boards, so decided to give it a go.

Installed the ESPHome addon into HA, plugged the C3 board into my laptop, added a Bluetooth proxy & compiled it, it compiles on the RPI4 & makes it stagger a bit, despite having several  goes at installing it, it baulks at the installation.


I used a downloaded ESP installer which works, after that all updates are done over wifi.


Sat & watched it, no devices showing in the log, tweaked to log to verbose, still nothing.


Edited the YAML to try various things, nothing.


Eventually, this works,


esphome:
  name: bluetooth-proxy
  friendly_name: Bluetooth Proxy

esp32:
  board: esp32-c3-devkitm-1
  framework:
    type: esp-idf
    sdkconfig_options:
      CONFIG_BT_BLE_50_FEATURES_SUPPORTED: y
      CONFIG_BT_BLE_42_FEATURES_SUPPORTED: y
      CONFIG_ESP_TASK_WDT_TIMEOUT_S: "10"

esp32_ble_tracker:
  scan_parameters:
# Adjust timing if the defaults do not work in your environment
#    interval: 1100ms
#    window: 1100ms
    active: true

bluetooth_proxy:
  active: true
 

# Enable logging
logger:
  level: DEBUG

# Enable Home Assistant API
api:
  encryption:
    key: "xxxxxxxxxx"

ota:
  - platform: esphome
    password: "xxxxxxxxxxxxxxxx"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Bluetooth-Proxy Fallback Hotspot"
    password: "xxxxxxxxxxxxx"

captive_portal:
   

It proxies the Bluetooth packets over wifi to whatever integration requires it (in my case Thermopro)
It runs seamlessly with the normal Bluetooth on the RPI4.

Result!

Ripe Atlas

 I've hosted a Ripe Atlas probe for many years.


https://www.ripe.net/analyse/internet-measurements/ripe-atlas/#:~:text=about%20RIPE%20Atlas-,About%20RIPE%20Atlas,that%20actively%20measure%20Internet%20connectivity.


One got lost in a move, but this one has been active since 2017.


It's a V3 probe based on a modified Tp link router,

It requires a usb stick which it chews up about every 6 months, symptoms are it going on & offline.

I should request either a V4 or a V5 probe neither of which need external usb memory, or even if I had a spare device, to host a probe in software.





It seems sensible to give something back to the Internet & you get credits to use for your own measurements, or to donate to others.

Thursday, 4 July 2024

Spam

 Today, a new path for spam.


An email from my domain provider, passing on a contact to the admin address for my domain.

Misspelt .info domain, which if I reply to, they then have my email address.


Thursday, 2 May 2024

Fibre UK vs Spain


 There was a time when BT were world leaders in anything telecommunications




.


A quick dirty comparison of fibre speeds, both £30 a month.


The UK seems to have an outdated idea of how fibre should be done, with the ONT where the fibre terminates being a fibre to copper converter, I think limited to 1Gb, also requires power. Then a copper patch lead to the router.

In Spain, the fibre terminates in an ONT, then a fibre patch lead to the router, any upgrades just mean changing the router, no silly speed caps on upload, it's symmetrical!, same speeds upload & download.

At this time they hit 85% of premises with fibre, 10Gb is available with 25Gb being trialled, all over the same, already installed fibre!

Come on BT/openreach, get back to being a world leader.


Tuesday, 12 March 2024

Tasmota Energy Monitoring Voltage Calibration

 In the UK, domestic mains voltage used to be standardised at 240V +6% -6% so a range of 225.6V to 254.4V,  in 1994 it was decided to harmonise with Europe at 230V, but with a fudge of -6% +10% so a range of 216.2V to 253V, but still nominally 240V. Europe changed from 220V to a nominal 230V.




247V at the top,  244V at the bottom, 0.5V per Div, Horizontal scale 30Sec per Div. Change of 2.5V over a matter of minutes, makes it hard to calibrate to 0.1V.

Tasmota energy monitoring has 2 commands to set voltage,  VoltageSet<x> Calibrate voltage to a target value in V with x denoting which channel if more than 1. & VoltageCal<x> range of 1000 to 32000 (Default 1950) VoltageSet changes VoltageCal to suit the target Voltage.


Several ways to calibrate the voltage, using a calibrated voltmeter.

Buy a mains Voltage calibrator (several £k)

Use a pure sinewave UPS or inverter (several £100)

Setup an audio generator to 50Hz, plug into an audio amplifier, connect to a low voltage transformer used in reverse, rated so no distortion, rough guess for about 50W is a 20V secondary (used as primary) transformer, transformer rated about 100W, allows enough to power the device under test. (Several £10)(This appeals to the geek in me)

Last is setup a Voltmeter & the device, feed with mains Voltage, repeatedly set the voltage until near enough, this is what I did, but it rankles that its not as accurate as it could be, especially when you want to get several devices to agree with each other.