Lora communication with Shelly - nygma2004/km GitHub Wiki

01: Basics

This page contains the links and examples shown in my "How Lora works with Shelly" videos. The basics video offers and introduction into what Lora communication is, and how it can be used with Shelly devices.

Video

As mentioned in video #06 you can use the event_handler and status_handler to test what event and/or status messages are sent by devices/components.

02: Setup

The second episodes details the setup of the Shelly Lora Add-on module and discusses the Loda radio configuration basics.

Video

Airtime Calculator

Encryption Key Generator

Basic text message sender example: lora_send_msg

And the receiver script example: lora_receive_msg

03: Virtual button: opening car gate

This example uses a virtual component (virtual button) defined on the sender Shelly, and it triggers the remote Shelly over Lora to turn on a relay. This can be used to operate open a car gate/garage from the phone.

Video

Setup steps in summary:

  • Create a virtual component (button type)
  • Create a virtual group and add the component to the group.
  • Expose the virtual group as a device, so it is easier to access it in the Shelly app
  • Add the sender script to the sender device: lora_virtual_button_sender
  • Add the receiver script to the remote device: lora_virtual_button_receiver

04: Virtual switch: turning remote lights on and off

In this example we create a remote output which is operated by a virtual switch. For example a garden light which is operated by Lora outside the wifi range.

Video

Setup steps in summary:

05: Doorbell: sending data back from the remote device

In this example we set up the two devices so both can send and receive data. In the earlier examples we only sent data from the wifi (gateway) to the remote device, but this time information is also sent back. We use one of the input on the remote Shelly, and the button press is sent back via Lora.

Video

Setup steps in summary:

  • Create a virtual component (button type)
  • Create a virtual group and add the component to the group.
  • Create and action/scene for the new virtual component that will handle the received button press event.
  • Set up the input as detached (since we used the output for a different scenario is video #04)
  • Add the script to the gateway device: lora_doorbell_gateway
  • Add the script to the remote device: lora_doorbell_remote

06: Send sensor data from BLU device

In this example we connect a BLU temperature and humidiy sensor and send it's values over to the gateway via Lora. This example shows you how you could do the same with other BLU devices or metrics from the remote device itself.

Video

Setup steps in summary:

  • Add the BLU device to the remote device
  • Create a virtual components (number type)
  • Create a virtual group and add the component to the group.
  • Add the script to the gateway device: lora_btht_gateway
  • Add the script to the remote device: lora_btht_remote

07: Range test

If you want to conduct the same range test, here are the scripts I used.

Video

Setup steps in summary:

  • Create a virtual components (two number type, and one boolean type)
  • Create a virtual group and add the component to the group.
  • Add the script to the gateway device: lora_range_test_base_station
  • Add the script to the remote device: lora_range_test_remote