Code Monkey home page Code Monkey logo

iot-thingsboard's Introduction

Coffee Machine in Thingsboard

The python code sends data to Thingsboard, like how much money you have, whether it is enough to buy a coffee or not, and the current cost of the coffee.

If you start the python script, you can do the following:

options

  • Buy a coffee (only if you have enough money)
  • Pay in money (to buy more coffee in the future)
  • Check your balance, how much money you have left

Created Dashboard in Thingsboard

On the created dashboard, you can see your current money what's left, whether it is enough to buy a coffee or not, and the current cost of the coffee. Also, you can see alerts, which indicating that you don't have enough money.

dashboard

How to run

  • Install Thingsboard On Premise or using Docker, or use the Demo version online.
  • Create a device in your Thingsboard.
  • In the python code, change the THINGSBOARD_HOST and the DEVICE_ACCESS_TOKEN constants.
  • Create the alarm and the dashboard in thingsboard (or you can import the .json files).
  • Install the python dependencies then run the python code in your terminal:

pip install mqtt

python coffee_machine.py

Create the alarm

  1. Create a new rule chain

It will send an alarm if you have not enough money to buy a coffee. You can import it with the help of the not_enough_money_alarm.json file.

alarm_rule_chain

The script:

alarm_script

  1. Change the root rule chain

Attach the new, alarm rule chain at the end of the root rule chain.

root_rule_chain

iot-thingsboard's People

Contributors

ujvarivera avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.