Hello to all
First timer around here and I am looking for assistance on my little project. (thanks to all who share your knowledge about this, specially @GUTEK@ )
Here is where I am so far
- I am running OpenBK7231N on the "Tuya Generic Temperature and Humidity Sensor Battery Powered SHT30" devices.
- I have a MQTT broker already running on a server as I will need to capture that data later. This works OK.
I require your asistance with the following.
1- I need to refine an autoexec.bat so the device wakes only every 30 minutes, get the readings and sends them via MQTT
2- I would like to have an specific data payload published via MQTT instead of all the information that the device pushes by default
Here is my autoexec.bat file so far, which definitely needs some improvement on the 'publishChannels' section
the MQTT topic i want to use should include the MAC address of the device
fcv/{MAC}/temperature
fcv/{MAC}/humidity
fcv/{MAC}/batteryLevel
The payload of each variable should include the channel value and date and time of te reading
will appreciate your help
First timer around here and I am looking for assistance on my little project. (thanks to all who share your knowledge about this, specially @GUTEK@ )
Here is where I am so far
- I am running OpenBK7231N on the "Tuya Generic Temperature and Humidity Sensor Battery Powered SHT30" devices.
- I have a MQTT broker already running on a server as I will need to capture that data later. This works OK.
I require your asistance with the following.
1- I need to refine an autoexec.bat so the device wakes only every 30 minutes, get the readings and sends them via MQTT
2- I would like to have an specific data payload published via MQTT instead of all the information that the device pushes by default
Here is my autoexec.bat file so far, which definitely needs some improvement on the 'publishChannels' section
// activación del ahorro de energía
PowerSave 1
// activación del controlador para manejar SHT30
startDriver SHT3X
// mantener presionado el botón forzará el modo de servicio
addEventHandler OnHold 20 SafeMode
// activación del contador que pondrá el módulo en suspensión en caso de falta de conexión wifi
addRepeatingEventID 60 -1 1337 DeepSleep 600
// calibración y medición 18650 4.2V, min 2.5V
//Battery_Setup 2500 4200 2.29 2400 4096
Battery_Setup 1600 3200 2.29 2400 4096
battery_measure
SHT_cycle 15
mqtt_broadcastInterval 1
mqtt_broadcastItemsPerSec 5
[inContentAd]
// esperando la conexión wifi
waitFor WiFiState 4
cancelRepeatingEvent 1337
// lo mismo que arriba pero ahora suspensión en caso de falta de conexión mqtt
addRepeatingEventID 30 -1 1337 DeepSleep 600
// esperando la conexión mqtt
waitFor MQTTState 1
cancelRepeatingEvent 1337
// si SHT tiene errores, se pueden hacer correcciones
SHT_Calibrate -0.8 2
SHT_Measure
delay_s 1
publishChannels
delay_s 5
// suspensión profunda por 15 minutos
DeepSleep 875
the MQTT topic i want to use should include the MAC address of the device
fcv/{MAC}/temperature
fcv/{MAC}/humidity
fcv/{MAC}/batteryLevel
The payload of each variable should include the channel value and date and time of te reading
{
"value": 90,
"timestamp": "2024-06-30T15:30:00Z"
}
will appreciate your help