Add Weather Station

source

https://github.com/maliciamrg/Bresser-Weather-Station

dns

xampp install

xamp server
sudo apt update -y
sudo apt upgrade -y
wget "https://downloads.sourceforge.net/project/xampp/XAMPP%20Linux/8.2.4/xampp-linux-x64-8.2.4-0-installer.run?use_mirror=netix&download=" -O xampp-linux-x64-8.2.4-0-installer.run
sudo ./xampp-linux-x64-8.2.4-0-installer.run
sudo usermod -aG daemon david
sudo chown -R daemon:daemon /opt/lampp/htdocs
sudo chmod g+w /opt/lampp/htdocs

result :

auto start xampp server at ubuntu startup:

sudo nano /etc/systemd/system/xampp.service
[Unit]
Description=XAMPP

[Service]
ExecStart=/opt/lampp/lampp start
ExecStop=/opt/lampp/lampp stop
Type=forking

[Install]
WantedBy=multi-user.target
sudo systemctl enable xampp.service
sudo reboot

after reboot

scripting

sudo apt update
sudo apt install php-cli unzip -y
cd ~
curl -sS https://getcomposer.org/installer -o composer-setup.php
HASH=`curl -sS https://composer.github.io/installer.sig`
php -r "if (hash_file('SHA384', 'composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
cd /opt/lampp/htdocs
mkdir weatherstation
cd weatherstation

install php app

sudo git clone https://github.com/maliciamrg/Bresser-Weather-Station.git .
sudo composer require php-mqtt/client
sudo chown -R daemon:daemon /opt/lampp/htdocs

result

pfsense

in pfsense allow MQTT traffic from VLAN 10 and VLAN 20 to VLAN 30 on port 1883, where your Mosquitto broker lives (192.212.30.105)

โœ… Steps to Add Rules in pfSense

Youโ€™ll need to add two rules โ€” one on each VLAN interface (VLAN 10 and VLAN 20):

๐Ÿ”ง On VLAN 10 Interface:

  1. Go to pfSense Web UI โ†’ Firewall โ†’ Rules โ†’ VLAN 10
  2. Click “Add” rule at the top
  3. Set:
    • Action: Pass
    • Interface: VLAN 10
    • Protocol: TCP
    • Source: Single host or alias โ†’ 192.212.10.200
    • Destination: Single host โ†’ 192.212.30.105
    • Destination port range: From 1883 to 1883
    • Description: Allow MQTT from VLAN 10
  4. Save and Apply Changes

๐Ÿ”ง On VLAN 20 Interface:

Repeat the same steps:

  1. Go to Firewall โ†’ Rules โ†’ VLAN 20
  2. Add rule with:
    • Source: 192.212.20.250
    • Destination: 192.212.30.105
    • Port: 1883
    • Description: Allow MQTT from VLAN 20
  3. Save and Apply Changes

๐Ÿงช Optional: Make It More Flexible

If you want any device on VLAN 10 or VLAN 20 to reach the MQTT broker, just change the source from single host to:

  • Source: VLAN 10 net
  • Source: VLAN 20 net

That way, all devices on those VLANs can connect.

test

http://192.212.20.250/weatherstation/updateweatherstation.php?ID=IANTON13&PASSWORD=nY2hD3eO&action=updateraww&realtime=1&rtfreq=5&dateutc=now&baromin=29.91&tempf=75.9&dewptf=60.4&humidity=59&windspeedmph=3.5&windgustmph=4.0&winddir=45&rainin=0.0&dailyrainin=0.0&indoortempf=81.1&indoorhumidity=53

controle

http://192.212.20.250/weatherstation/updateweatherstation.php

WR840N v6 firmware openwrt

https://openwrt.org/toh/hwdata/tp-link/tp-link_tl-wr840n_v6

Firmware version:0.9.1 4.19 v0001.0 Build 220120 Rel.55489n
Hardware version:TL-WR840N v6 0000000

https://firmware-selector.openwrt.org/?version=19.07.4&target=ramips%2Fmt76x8&id=tl-wr840n-v4

https://github.com/IcedShake/openwrt-19.07-tl-wr840n-v6.x

Compiled file for OpenWrt V6

https://www.dropbox.com/s/fkaiy4rttwpwr6b/openwrt-ramips-mt76x8-tl-wr840n-v6-squashfs-sysupgrade.bin?dl=0

https://www.dropbox.com/s/tu27bcsantl0ezq/openwrt-ramips-mt76x8-tl-wr840n-v6-squashfs-tftp-recovery.bin?dl=0

smart shutter firmware

https://github.com/openshwprojects/OpenBK7231T_App

https://templates.blakadder.com/WF-CS01_EU.html

https://developer.tuya.com/en/docs/iot/wb3s-module-datasheet?id=K9dx20n6hz5n4

https://community.home-assistant.io/t/detailed-guide-on-how-to-flash-the-new-tuya-beken-chips-with-openbk7231t/437276

https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/commands.md

https://www.elektroda.com/rtvforum/viewtopic.php?p=20433363#20433363

//Channel 0 ==> opening 
//Channel 1 ==> stop 
//Channel 2 ==> closing 
//Channel 3 ==> Color Blue (night Mode) 
//Channel 4 ==> value_template (open / closed)


//blue led on
SetStartValue 3 1

// interlock relais
addChangeHandler Channel0 == 1 SetChannel 2 0
addChangeHandler Channel2 == 1 SetChannel 0 0

//cancel button
addChangeHandler Channel1 == 1 SetChannel 0 0
addChangeHandler Channel1 == 1 SetChannel 2 0

//toggle night led mode
addEventHandler OnHold 10 ToggleChannel 3

//auto cancel relais after delai 34s
addChangeHandler Channel0 == 1 addRepeatingEventID 34 1 910 backlog SetChannel 0 0;SetChannel 4 1;
addChangeHandler Channel2 == 1 addRepeatingEventID 34 1 912 backlog SetChannel 2 0;SetChannel 4 0;

//auto cancel cancel button after 5s
addChangeHandler Channel1 == 1 addRepeatingEventID 5 1 911 SetChannel 1 0

//auto cancel cancel relai
addChangeHandler Channel1 == 1 cancelRepeatingEvent 910
addChangeHandler Channel1 == 1 cancelRepeatingEvent 912

https://community.home-assistant.io/t/template-cover-for-garage-door/241763/26

      garden:
        unique_id: template_cov_gardene
        device_class: shutter
        friendly_name: "Cover Garden"
        open_cover:
          - service: switch.turn_on
            target:
              entity_id: switch.obk61c3f99d_0
        close_cover:
          - service: switch.turn_on
            target:
              entity_id: switch.obk61c3f99d_2
        stop_cover:
          service: switch.turn_on
          target:
            entity_id: switch.obk61c3f99d_1
        value_template: >-
          {% if is_state('switch.cover_garden_4', 'on') %}
            open
          {% else %}
            closed
          {% endif %}

Wall Thermostat firmware

https://tasmota.github.io/docs/devices/TYWE3S/

https://templates.blakadder.com/Moes_WHT-HY609.html

https://github.com/blakadder/templates/blob/master/_templates/Moes_WHT-HY609

https://tasmota.github.io/docs/TuyaMCU/#dpid

https://github.com/sillyfrog/Tasmota-Tuya-Helper

{"NAME":"WHT-HY609-GB-WH-MS","GPIO":[0,2304,0,2272,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":54,"CMND":"tuyamcu 11,1 | tuyamcu 71,3 | tuyamcu 72,2 | tuyamcu 63,4"}

https://blakadder.com/tuya-climate/

mqtt:
  climate:
    name: "MQTT Heater"
    unique_id: mqtt_heater_generic_thermostat
    modes: 
      - "heat"
      - "off"
    mode_command_topic: "cmnd/tasmota_6F492A/POWER1"
    mode_command_template: "{{'1' if value == 'heat' else '0'}}"
    mode_state_topic: "tele/tasmota_6F492A/STATE"
    mode_state_template: "{{'heat' if value_json.POWER == 'ON' else 'off'}}"
    current_temperature_topic: "tele/tasmota_6F492A/SENSOR"
    current_temperature_template: "{{value_json['TuyaSNS']['Temperature']}}"
    temperature_state_topic: "tele/tasmota_6F492A/SENSOR"
    temperature_state_template: "{{value_json['TuyaSNS']['TempSet']}}"
    min_temp: 18
    max_temp: 28
    precision: 0.5
    temperature_command_topic: "cmnd/tasmota_6F492A/TUYASEND2"
    temperature_command_template: "2,{{value*10|int}}"
    availability_topic: tele/tasmota_6F492A/LWT
    payload_available: Online
    payload_not_available: Offline

smart switch

https://codesandbolts.com/girier-smart-switch-wifi-w6b

https://github.com/ct-Open-Source/tuya-convert/issues/721

Hi Guys,
I also had a long time to try flash this WiFI-W6B. My solution is to unsolder and lift up pin 11 of unmarked chip (see yellow route on screen above). This route is connected to U0RXD (pin 25) of ESP8285 and probably blocking UART exchange.
Also don’t forget about GPIO0.
Good luck all.

In this PCB we can see a different orientation of unmarked chip. After tracing I make sure that pin 5 (not 11 as earlier!) is connected to pin 25 (U0RXD) of ESP8285. When I applied the previous method and lift up pin 5 of unmarked chip, flashing was started.

{"NAME":"1 Gang","GPIO":[0,288,0,0,0,32,0,0,224,0,0,0,0,0],"FLAG":0,"BASE":1}
{"NAME":"2 Gang","GPIO":[0,288,0,32,33,0,0,0,0,224,225,0,0,0],"FLAG":0,"BASE":29}
{"NAME":"3 Gang","GPIO":[0,52,0,17,19,18,0,0,22,21,23,0,0],"FLAG":0,"BASE":30}