Commit Graph
95 Commits
Author SHA1 Message Date
Florian 4e885a7cd0 [BT] Regular BT connect based on time (#1423)
instead of number of scans, as users changing the interval to continuous scanning may have connect attempts to frequently
2023-01-26 09:28:16 -06:00
Northern Man 150603555c Update to ZdisplaySSD1306 to reduce overall resource usage, and enable message queuing (#1417) 2023-01-26 08:17:53 -06:00
Merijn 6e3e8c3330 [RS232] add JSON parsing and hardware serial support to RS232 gateway (#1409)
* add JSON parse option to RS232 gateway

* add hardware UART support to RS232 gateway

* changed default RS232toMQTTmode to raw (instead of JSON)

* removed reference to Arduino Mega in RS232 gateway config

* update RS232 gateway doc
2023-01-25 16:43:53 -06:00
Die Peter Pan 9687f605c8 Added board ESP32 DOIT DevKit V1 with SX1278 module Ai-Thinker Ra01 (#1411)
* Added board ESP32 DOIT DevKit V1 with SX1278 module Ai-Thinker Ra01

Gateway using RTL_433_ESP library, need SX1278
ESP32 DOIT DevKit V1 & external Ai Thinker Ra01 Loraboard SX1278 on VPSI and (DIO0=15, DIO1=4, DIO2=16 and RST=17)
2023-01-23 11:40:27 -06:00
Florian a3603c6a78 [BLE] Simplify the publication of advertisement data (#1408)
With only one control that enables the publication of all the advertisement data, default: false
Note that if the sensor is not recognized, we will no longer publish its advertisement data unless the control is true. This is for the sake of traffic reduction.
2023-01-20 14:30:11 -06:00
Northern Man 9d6f7a0764 ssd1306 display of module messages (#1383)
* ssd1306 display of module messages

Supported Modules Include
- rtl_433
- bme280

* Switch to use convertTemp_CtoF
2023-01-11 20:31:12 -06:00
Dattel 5fcf02af5a Small fix on BME280 Config & CC1101-TXPower Throttle (#1382)
* https://github.com/1technophile/OpenMQTTGateway/issues/1380
CC1101 TXPower selection

* Creates the possability the define SDA/SCL Pins correct through a compiler switch from the platformio.ini
Sample:
  '-DBME280_PIN_SDA=0'
  '-DBME280_PIN_SCL=2'
2023-01-10 20:13:06 +01:00
DigiH 8a767cf4b8 Typo fixes (#1381) 2023-01-08 07:43:15 -06:00
FlorianandNorthernMan54 16815f51da Add RTL_433 discovery with Home Assistant convention inspired from rtl_433_mqtt_hass.py (#1379)
This also changes the topic structure when using the macro valueAsATopic=true, it adds as sub-topics the `type, subtype, and channel` when they exist.
The id is the last subtopic to facilitate filtering, as it may change when replacing the batteries.

Co-authored-by: NorthernMan54 <19808920+NorthernMan54@users.noreply.github.com>
2023-01-07 20:34:43 -06:00
Northern Man 2e0d1708c3 Update to rtl_433_ESP 0.1.5 and support for LILYGO® LoRa32 V2.1_1.6.1 433 Mhz (#1371)
* Update to rtl_433_ESP 0.1.5

Includes support for LILYGO® LoRa32 V2.1_1.6.1 433 Mhz

* Fix lint issue

* Fix build and lint issues

* Add lilygo-rtl_433 to build.yml
2022-12-26 13:48:08 -06:00
Florian 8dde777fb7 [BLE] Add dynamic active scan runtime setting (#1360)
This commit add the capability to set passive scanning during runtime, versus buildtime before, so as to improve energy consumption of sensors when they don't require active scanning
2022-12-14 17:03:34 -06:00
Florian dee3ef4de5 Improve reset mechanism when MQTT is not connected (#1338)
This enables to wait less for the reset to trigger
2022-11-30 14:27:27 -06:00
Florianandh2zero 8ee1c4e524 RN8209 energy sensor support with watt, voltage and current. (#1337)
Co-authored-by: h2zero <powellperalta@gmail.com>
2022-11-29 18:41:47 -06:00
Florian 3e9fbb21ff Move the button check at start of the program (#1330)
So as to enable to trigger the wm portal before the setup of all the modules
2022-11-28 20:04:48 -06:00
Florian ec21cbb880 Update default certificate of Github (#1322)
So as to enable updates with a payload without the cert, and add a command example. Also so change the update message to notice level
2022-11-16 15:16:32 -06:00
Northern Man fd8c3a79ae Updated docs for the Heltec ESP32 Board (#1301) 2022-10-23 19:34:59 -05:00
Florian bf38bb52f6 Remove HM10 support (#1282)
Removing HM10 support as announced in the forum
2022-10-10 20:34:12 -05:00
Bad 312ef858c1 Modify new BT config using MQTT (#1259)
* Move BTConfig_default to ZgatewayBT.ino as BTConfig_init()

* Remove unused function declaration & typo

* Move bleconnect outside of ifdef ESP32

* Add new parameters to json payload on MQTTtoBT/config
And move them to function BTConfig_fromJson()

new parameters: [presenceEnable, presenceTopic, presenceUseBeaconUuid, extDecoderEnable,
extDecoderTopic, filterConnectable, pubKnownServiceData,
pubUnknownServiceData, pubKnownManufData, pubUnknownManufData,
pubServiceDataUUID, pubBeaconUuidForTopic]

* Add ignoreWBlist as new configuration parameter

* Keep hasspresence keyword (do not use presenceEnable)

* Documentation

* Typos & Optimizations arround RemoveJsonPropertyIf

* Template for BT config update

* Ensure BTConfig.minRssi sign does not matter

* Report configuration change on topic /commands/BTtoMQTT/config

# Conflicts:
#	main/ZgatewayBT.ino

* Add BT config bool commands (init, load, erase & save) to persist config parameters

* Documentation

* Fix pre-compilation issue

* Fix Code Format

* Use Preference only for ESP32

* Update Doc
2022-09-03 15:08:07 -05:00
DigiH c4300a002f MQTT-MAC-IP-mDNS (#1245) 2022-07-19 12:10:51 -05:00
DigiH 1c62d74e56 Typo-fixes (#1244) 2022-07-19 07:53:38 +02:00
DigiH 0f57eddb01 typo fixes (#1243) 2022-07-18 11:30:37 -05:00
Bad 9154e6cc46 Typo in commands/MQTTtoSYS/config (#1236) 2022-07-13 23:47:06 +02:00
DigiH 0d4909d44d Typo fixes (#1233) 2022-07-13 04:49:08 -05:00
steadramonandPaul 5b697e0306 Add Pilight limitProtocols support (#1223)
* Add ability to limit protocols

* Make serial feedback notice

Co-authored-by: Paul <steadramon@local>
2022-06-05 11:47:56 -05:00
Florian bfed83bbc9 Update certificate in the examples for OTA (#1213)
update certificate to the root authority
2022-05-13 14:55:24 -05:00
h2zero 8d6acbee12 Add Switchbot support and discovery. (#995)
* Use a task to process immediate BLE actions to prevent MQTT disconnection if the action takes too long to complete.

* Add state_on and state_off parameters to createDiscovery
2022-04-30 09:16:06 -05:00
Joseph Perry 4b872bebbe Add ability to specify pulse length in ZactuatorONOFF (#1200)
* Add ability to specify pulse length in ZactuatorONOFF

Add an additional parameter to the MQTT message to control the actuatorONOFF pulse length e.g. `mosquitto_pub -t home/OpenMQTTGateway_MEGA/commands/MQTTtoONOFF -m '{"gpio":15,"cmd":"high_pulse","pulse_length":25}'`

* Simplify initialization of pulselength
2022-04-20 02:55:14 -05:00
h2zero f8b4b3ca21 Add "mac_type" parameter to BLE connection commands. (#1146)
This allows for connecting to devices that do not use the MAC address type 0.
This also adds the logging of the "mac_type" so it is visible to users trying to connect to broadcasting devices.

Additionally this will allow for future connectable devices using a MAC address type other than 0 to be automatically connected to
when support is added for them, similar to LYWSD03MMC etc..
2022-01-25 06:19:50 -06:00
h2zero 5dac1a7035 Add immediate parameter to BLE connection commands. (#1137)
* Add immediate parameter to BLE connection commands.

When sending a command to read/write a characteristic on a BLE server this adds a new parameter to cause the action to be
performed immediately. This will stop the scan in progress to perform the actions queued.

Example use:
```
mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoBT/config -m '{
  "ble_write_address":"AA:BB:CC:DD:EE:FF",
  "ble_write_service":"cba20d00-224d-11e6-9fb8-0002a5d5c51b",
  "ble_write_char":"cba20002-224d-11e6-9fb8-0002a5d5c51b",
  "ble_write_value":"TEST",
  "value_type":"STRING",
  "ttl":4,
  "immediate":true }'
```

Stop BLE processing when immeditate command sent.

* Use a shorter connection timeout.

* Update docs.

* Remove MQTT spam for connection retrys

* Prevent crashing when the normal connection process occurs at the same time as an immediate action.

* Use a semaphore to protect BLE device vector.
2022-01-23 19:47:17 -06:00
Benoit Courty 5c3eccbb18 Adding low_pulse (#1120)
* Adding low_pulse
2022-01-01 19:47:23 -06:00
Stephen Littman 7c5538be65 Doc spelling typo (#1104)
Fixed typo
2021-12-04 13:48:15 -06:00
h2zeroandFlorian ca616939b8 Add ability to change MQTT topic and or gateway name by MQTT command. (#1053)
* Add ability to change MQTT topic and or gateway name by MQTT command.

This adds new commands to allow changing the MQTT topic and or gateway name from a command.
The new topic/name will be saved in flash memory and used on subsequent reboots.
Either/both parameters can be sent or combined with other commands.

Example use:
```
mosquitto_pub -t "home/OpenMQTTGateway/commands/MQTTtoSYS/config" -m
'{
  "mqtt_topic": "topic/",
  "gateway_name: "name"
}'
```

* Update example with /

Co-authored-by: Florian <1technophile@users.noreply.github.com>
2021-08-05 05:50:16 -05:00
DigiH 3fd075b750 Disable MQTTsetMQTT and MQTT_HTTPS_FW_UPDATE to allow OTA for Avatto (#1046)
* Disable MQTTsetMQTT and MQTT_HTTPS_FW_UPDATE to allow OTA for Avatto Bakery IR

Trying to update my Avattos with the currently released 0.9.8 I found that OTA wasn't possible any longer as the build was now to large

0.9.8
Checking size .pio/build/avatto-bakeey-ir/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [====      ]  42.4% (used 34772 bytes from 81920 bytes)
Flash: [======    ]  55.2% (used 528716 bytes from 958448 bytes)

this goes back to 0.9.7, where WiFi, MQTT and firmware update was introduced over MQTT commands

0.9.7
Checking size .pio/build/avatto-bakeey-ir/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [====      ]  42.4% (used 34772 bytes from 81920 bytes)
Flash: [======    ]  55.2% (used 528716 bytes from 958448 bytes)

Going back to building 0.9.6 I was able to OTA update again with the much smaller build

0.9.6
Checking size .pio/build/avatto-bakeey-ir/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [====      ]  39.7% (used 32512 bytes from 81920 bytes)
Flash: [====      ]  41.4% (used 396804 bytes from 958448 bytes)

Building 0.9.8 with the flags brings the build back to OTAable size

0.9.8 with
	'-UMQTTsetMQTT'
	'-UMQTT_HTTPS_FW_UPDATE'
Checking size .pio/build/avatto-bakeey-ir/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [====      ]  39.9% (used 32684 bytes from 81920 bytes)
Flash: [====      ]  42.3% (used 405024 bytes from 958448 bytes)

Similar to the flag setting in [env:rfbridge]

I'm not even sure if MQTT_HTTPS_FW_UPDATE would even work on the Avatto, with the limited flash memory. 

Should we also add

board_build.ldscript = eagle.flash.1m64.ld

as a default, as it's required for OTA updates on the Avattos as discussed in https://github.com/1technophile/OpenMQTTGateway/issues/763#issuecomment-698864712 ?

* Doc addition for restricted MQTT options

Doc addition for https://github.com/1technophile/OpenMQTTGateway/pull/1046 and https://github.com/1technophile/OpenMQTTGateway/pull/986
2021-08-02 15:51:13 -05:00
h2zero 2dedabc52f Add "server_cert" parameter to firmware_update command. (#1043)
When updating from the MQTT command from a SSL enabled server this adds an option to provide
the server SSL certificate with the command.

This is useful if connecting to different servers or if the configured certificate has expired
and requires updating to not lose the ability to update via OTA.

The certificate provided will be saved to flash memory for use on subsequent restarts.
2021-07-29 16:13:30 -05:00
Florian 373ec29803 Correct LORA embedded video (#1030) 2021-07-20 19:01:20 -05:00
Florian c06a6c9ceb [DOCS] Add new devices, parameters and LORA tutorial (#1028)
* Add new devices and parameters
* Update readme and lora use
2021-07-18 14:18:40 -05:00
Florian bce9bf3e00 Minor readme update (#1025)
* readme and BLE update
2021-07-16 20:09:47 -05:00
FlorianandDave ebe17c8899 Setmqtt setting optional (#1021)
* Define MQTTsetMQTT for configuring MQTT over MQTT

* Enable MQTTsetMQTT per default on all ESP except RFBridge

Co-authored-by: Dave <d.kneisz@gmail.com>
2021-07-14 17:25:09 -05:00
h2zero 3f13984f44 Bugfix: switching brokers with self signed certs. (#1007)
* Fixes BLE scanning being disabled after switching server fails.

* Fixes crash caused by BLE scan results arriving while switching servers.

* Adds documentation to use the server switching command.
2021-07-05 19:40:40 -05:00
h2zero 7cfbd3d050 Ble read/write characteristics over MQTT. (#988)
* EXPERIMENTAL: Ble read/write characteristics over MQTT.

Uses #979

This allows reading and writing BLE characteristics from an MQTT message.

Example format:
mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoBT/config -m '{"ble_write_address":"AA:BB:CC:DD:EE:FF", "ble_write_service":"cba20d00-224d-11e6-9fb8-0002a5d5c51b", "ble_write_char":"cba20002-224d-11e6-9fb8-0002a5d5c51b", "ble_write_value":"TEST", "ttl":4 }'
mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoBT/config -m '{"ble_read_address":"30:AE:A4:7C:3C:A6", "ble_read_service":"cba20d00-224d-11e6-9fb8-0002a5d5c51b", "ble_read_char":"cba20002-224d-11e6-9fb8-0002a5d5c51b", "ttl": 2 }'
The ttl parameter is the number of calls to connect (defaults to 1), which occur after the BLE scan completes.

A response is provided over MQTT in the format:
write : {"id":"30:AE:A4:7C:3C:A6","service":"cba20d00-224d-11e6-9fb8-0002a5d5c51b","characteristic":"cba20002-224d-11e6-9fb8-0002a5d5c51b","write":"TEST","success":true}
read : {"id":"30:AE:A4:7C:3C:A6","service":"cba20d00-224d-11e6-9fb8-0002a5d5c51b","characteristic":"cba20002-224d-11e6-9fb8-0002a5d5c51b","read":"TEST","success":true}

* Add generic BLE connect class and read data as hex.

* Add value_type parameter and document usage

* Add note to docs
2021-06-21 20:27:06 -05:00
h2zero b8b99c6d5d Add Wifi and mqtt broker configuration over MQTT commands (#971)
- Adds MQTT command to change the WiFi access point.
- Adds MQTT command to change the MQTT broker and update username and password.

This will test the connection changes first and, if unsuccessful, fallback to the current connection.
If successful the new configuration will be saved in non-volatile memory.
2021-06-05 16:52:30 -05:00
Leon Kiefer 18c8524ae0 added somfy repeat option (#957)
update somfy dependency to fix bug with multiple somfy remotes
2021-05-24 15:09:18 -05:00
h2zero 295d39bc27 Trigger firmware update via MQTT (ESP Only). (#953)
If enabled in user_config.h this will trigger the OMG to update it's firmware from the link
provided in the MQTT message.

Example message:
{\"version\":\"test\",\"password\":\"OMGPASSWORD\",\"url\":\"https://github.com/1technophile/OpenMQTTGateway/releases/download/v0.9.6/esp32dev-ble-cont-firmware.bin\"}

If the firmware version in the message is not the same as the current OMG version the device will self update using the link in the url of the message.
2021-05-23 16:38:52 -05:00
Northern ManandNorthern Man f69906861d Active Receiver Switching (#936)
* PR #934

* Active Receiver Switching

Switching of the active receiver module is available between the RF,
RF2, RTL_433 and Pilight Gateway modules, allowing for changing of
signal decoders without redploying the openMQTTGateway package.
Sending a JSON message to the command topic of the desired receiver
will change the active receiver module.

Other minor adjustments/improvements

1 - Improved startup serial logging that includes
- OpenMQTTGateway Version
- OpenMQTTGateway Modules

2 - Trace logging of full Gateway module command topic
 - Enabled in RF, RF2, PiLight and RTL_433

3 - Updated RTL_433 Documentation to only include enabled ASK/OOK
device decoders

4 - Trace logging of MQTT Callback topic

* Regression testing

* Adding valueAsASubject support to rtl_433_ESP
- model and id keys are appended to message topic

* Increased memory size for receiver switching in blocking build all

Co-authored-by: Northern Man <sgracey@Heisenberg.local>
2021-05-10 19:36:25 -05:00
DigiH ac41f95cfc Typo fix (#924)
Type in sending status command to MQTTtoRTL_433. "-1" should be "1" as it produces an error otherwise.
2021-04-14 20:02:48 -05:00
Florian e1aef48296 [Breaking] Deactivate Home Assistant presence per default (#915)
And enable to activate it by MQTT
2021-04-04 19:34:36 -05:00
Florian adc5f157cd Add hass auto discovery gif and img (#916)
and update M5Stack docs
2021-04-04 14:53:00 -05:00
Florian 8afb1c5223 Enable deactivation of BLE connect (#895)
Useful if you want to scan continuously for BLE device, in this case you should deactivate the BLE connect to avoid concurrency between scan and connect
2021-03-14 12:53:26 -05:00
Northern ManandNorthernMan54 57bc108da4 Initial pull request for rtl_433 support (#886)
* Initial pull request for rtl_433 support

Co-authored-by: NorthernMan54 <sgracey@Bart.local>
2021-03-11 12:43:05 -06:00
Florian a6fb17595e [BREAKING] remove tem key (#883)
* [BREAKING] remove tem key

we rely now on tempc and tempf only
2021-03-03 18:38:37 -06:00