Comments (2)
Hi,
I haven't tested these things but I think you can piece it together based on the javascript code and html you can see when inspecting the page in your browser.
Inspecting the reboot button shows that it calls a javascript function called writeConfig('restart')
.
This is the code of that function:
function writeConfig(cmd){
var elements = document.getElementById("configForm").elements;
var params = "";
for (var i = 0, element; element = elements[i++];) {
if (element.type == "checkbox"){
if (element.checked == true){
params += element.name + "=true&"
}else{
params += element.name + "=false&"
}
}else{
params += element.name + "=" + element.value + "&"
}
}
var http = new XMLHttpRequest();
http.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
iqwerty.toast.Toast(this.responseText);
}
};
http.open("POST", "api", true);
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.send("cmd=" + cmd + "&" + params);
}
Based on the final three lines I would say that you have to sent a post request to the /api
URL with the command formatted in the same style as can be seen in the last line in the function.
When I click the button with a breakpoint set on that final line, the params seem to contain all settings from the settings page. I am not sure if you need all of those as well to restart the dongle. That is something you will have to test yourself.
This is what I get from the params variable at the end of the function. I have censored some sensitive stuff obviously
"ssid=********&password=********&dhcp=false&ip_0=0&ip_1=0&ip_2=0&ip_3=0&nm_0=0&nm_1=0&nm_2=0&nm_3=0&gw_0=0&gw_1=0&gw_2=0&gw_3=0&mqtt_broker_addr_0=192&mqtt_broker_addr_1=168&mqtt_broker_addr_2=1&mqtt_broker_addr_3=103&mqtt_broker_port=1883&mqtt_broker_username=********&mqtt_broker_password=********&mqtt_broker_client_id=&mqtt_devicetopic=jarolift&master_msb=********&master_lsb=********&learn_mode=true&serial=********&set_and_generate_serial=false&devicecounter=149&set_devicecounter=false&save=save&restart=restart the dongle&"
from jarolift_mqtt.
for me this is working in HA:
rest_command:
jaroliftdonglereset:
url: http://ip to your dongle/api
method: POST
content_type: "application/x-www-form-urlencoded"
payload: "cmd=restart"
thx @Scrath1 for the hint, was reseting the dongle with a shelly plug by now, will try this instead 👍
from jarolift_mqtt.
Related Issues (20)
- How do I connect NodeMCU and CC1101? HOT 2
- Wifi-Passwort do not accept characters like ";" HOT 1
- Admin mode error (blank page) HOT 2
- NTP won't work, if DHCP is disabled
- Feature: Time Scheduler HOT 5
- Backup? HOT 4
- Nur Up wird erkannt HOT 5
- ESP8266 only stable for a week HOT 10
- Exception error (0) on pressing learn-button in shutter HOT 1
- Increase reliability - an idea
- Homeassistant MQTT Einbindung HOT 10
- Compilation error HOT 2
- Not declared error messages
- error: could not convert while compiling
- Jarolift_MQTT vergisst Rolladenmotoren HOT 4
- Fertigmodul HOT 7
- Leiterplatine HOT 8
- Problem with WLAN password which inlcudes '&'
- File not found: did you upload the data directory?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jarolift_mqtt.