{"id":13499837,"url":"https://github.com/akshayvernekar/esp-webthing","last_synced_at":"2025-03-29T05:32:23.752Z","repository":{"id":208405183,"uuid":"230069686","full_name":"akshayvernekar/esp-webthing","owner":"akshayvernekar","description":"Esp idf compoment for creating Mozilla webthing","archived":false,"fork":false,"pushed_at":"2020-06-28T02:10:40.000Z","size":40,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-01-24T04:54:21.265Z","etag":null,"topics":["c","component","esp-idf","mozilla-iot"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/akshayvernekar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-12-25T08:25:48.000Z","updated_at":"2022-11-27T23:15:51.000Z","dependencies_parsed_at":"2023-11-21T10:41:20.465Z","dependency_job_id":"436c8901-5119-4ba0-b936-7daaba4e5040","html_url":"https://github.com/akshayvernekar/esp-webthing","commit_stats":null,"previous_names":["akshayvernekar/esp-webthing"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akshayvernekar%2Fesp-webthing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akshayvernekar%2Fesp-webthing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akshayvernekar%2Fesp-webthing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akshayvernekar%2Fesp-webthing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akshayvernekar","download_url":"https://codeload.github.com/akshayvernekar/esp-webthing/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246145012,"owners_count":20730494,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","component","esp-idf","mozilla-iot"],"created_at":"2024-07-31T22:00:43.758Z","updated_at":"2025-03-29T05:32:23.455Z","avatar_url":"https://github.com/akshayvernekar.png","language":"C","funding_links":[],"categories":["Section"],"sub_categories":["Libraries"],"readme":"# esp-webthing\nEsp idf component for creating Mozilla WebThing\n\n## Example Projects\nFor sample implementations look at [esp-webthing_examples](https://github.com/akshayvernekar/esp-webthing_examples.git) .\n\n\n## Usage\n### Create Thing\n```c++\nThing* createThing(const char* _title, char** _type)\n````\n    Parameters:\n        _title = human friendly string which describes the device\n        _type  = provides the names of schemas for types of capabilities a device supports.\n    For more info refer : https://iot.mozilla.org/wot\n\n### Create Property\n```c++\nThingProperty* createProperty(char* _title,PropertyInfo _info,PropertyChange_cb _callback)\n```\n    Parameters:\n        _title = human freindly string which describes the property.\n        _info  = PropertyInfo structure which represents the property.\n        _callback = is the callback function which will be notified whenever controls are changed . \n    callback function needs to have the format `void(*function_name)(ThingPropertyValue)`\n\nFollowing properties can be created\n\n| Property Type        | ValueType |\n|----------------------|-----------|\n| eALARM               | BOOLEAN   |\n| eBOOLEAN             | BOOLEAN   |\n| eBRIGHTNESS          | NUMBER    |\n| eCOLOR               | STRING    |\n| eCOLOR_TEMPERATURE   | NUMBER    |\n| eCURRENT             | NUMBER    |\n| eFREQUENCY           | NUMBER    |\n| eHEATING_COOLING     | STRING    |\n| eIMAGE               | NONE      |\n| eINSTANTANEOUS_POWER | NUMBER    |\n| eLEAK                | BOOLEAN   |\n| eLEVEL               | NUMBER    |\n| eLOCKED              | STRING    |\n| eMOTION              | BOOLEAN   |\n| eON_OFF              | BOOLEAN   |\n| eOPEN                | BOOLEAN   |\n| ePUSHED              | BOOLEAN   |\n| eTARGET_TEMPERATURE  | NUMBER    |\n| eTEMPERATURE         | NUMBER    |\n| eTHERMOSTAT          | STRING    |\n| eVIDEO               | NONE      |\n| eVOLTAGE             | NUMBER    |\n\n### PropertyInfo structure\nProperty Info structure is passed as a parameter for property creation .\n```c++\nstruct PropertyInfo\n{\n    ThingPropertyType type;\n    ThingPropertyValue value;\n    ThingPropertyValueType valueType;\n    double minimum;\n    double maximum;\n    double multipleOf;\n    bool readOnly;\n    PropertyUnits unit;\n}\n```\n    Parameters:\n        type = enum representing the property type.\n        value = value of the property.\n        valueType = value type can be one of the four BOOLEAN,NUMBER, STRING or NONE. \n                Refer the Property Type table for more info.\n        minimum = minimum permissible value for the property . \n                Applicable only for properties which have Range type values such as Brightness etc.\n        maximum = maximum permissible value for the property . \n                Applicable only for properties which have Range type values such as Brightness etc .\n        readOnly = specifies if the value of property can be changed . \n                Set it to TRUE if you dont want the user to change the value of property for example readings of a sensor.\n        unit = SI unit of the property .\n### Add Property to Thing object\n```c++\nvoid addProperty(Thing* _thing,ThingProperty* _property)\n```\n    Parameters:\n        _thing = pointer to the thing object \n        _property  = pointer to property object \n\n### Adding Property to Thing\n```c++\nvoid addProperty(Thing* _thing,ThingProperty* _property)\n```\n    Parameters:\n        _thing = pointer to the thing object \n        _property  = pointer to property object \n\n### Initialsing Adapter\nInitialses mdns with thing details.\n```c++\nvoid initAdapter(Thing* thing)\n```\n    Paremeters:\n        thing = pointer to thing object.\nNote: Call this before connecting ESP32 to wifi\n\n### Start Adapter\nStarts the webserver and initialises the handles .\n```c++\nvoid startAdapter(Thing* thing)\n``` \n    Paremeters:\n        thing = pointer to thing object.\nNote : Call this after ESP gets connected to the wifi network\n\n### Cleanup Thing\nFrees allocated memory for thing and its properties.\n```c++\nvoid cleanUpThing(Thing* thing)\n``` \n    Parameters:\n        _thing = pointer to the thing object \n\n### For sample implementation see : https://github.com/akshayvernekar/esp-webthing_examples\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakshayvernekar%2Fesp-webthing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakshayvernekar%2Fesp-webthing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakshayvernekar%2Fesp-webthing/lists"}