Package: remotecodes
remotecodesremotecodesis a curated repository of crowd-sourced IR / RF remote codes intended to be useful in home automation scenarios.Thus codes are not just an arbitrary list of key-value pairs, but must adhere to a strict schema per device domain, that gives
functional meaning to each code, which can later be interpreted by a higher level integration (for instance inHome Assistant).All codes are written usingremoteprotocolscommand notation
and all it'ssupported protocolsare available. See links for details.A codes file is always referenced asbrand.category.seq_numberUsageCodes files can be used directly from their yaml form.
If consumed frompython, there are some helper functions availablefromremotecodesimportget_codesfromremotecodes.schemaimportmedia_player,validate_source#intended as voluptuous validator for source string formatsource=validate_source("acme.tv.001")# find the correct codes file, validate it and return it as a dict# an optional <domain> can be marked as required# optional extra root folders can be added to the search. They take priority over built-in ones.codes=get_codes(source,"media_player",["my_extra_codes_root"])Command lineTo batch validate all codes files and their folder structure:remotecodesvalidate<codes_root_folder>Contributing CodesCodes comes from user contribution, so you are encouraged to share your files.HierarchyCodes files are organized in folders that must adhere to the pattern:brand/category/Files within each folder must be named according to the pattern:brand.category.seq_number.yamlThe brand and category must be consistent among folder, filename, file contentSchemaAll files must have a requiredinfosection and at least one domain section that follows it's respective schema. A device can have commands for more than one domain (i.e. afanand alight).
Additionally a freecustomsection can be added to include extra commands not tied to a well defined function.Sectioninfoinfo:#requiredbrand:Acme#requiredmodels:#required, min length: 1-Model Acategory:tv#requirednotes:<#optionalThis codes where learned and tested# At least one domain section requiredbrandandcategoryare validated against filename and path.categorymust be one of:air_conditioneraudio_playerav_receiverfanlightprojectorsettopboxspeakerswitchtunertvvideo_playerCommandsAll codes are written usingremoteprotocolscommand notation
and all it'ssupported protocolsare available. See links for details.This is often done as a single string, but if a multi command sequence is needed it can be expressed as an array of commands.
After validation all entries are converted to arrays.#single commandsome_function:nec:0xFE:0x7E#multi sequenceother_function:-nec:0x7E:0xA2-nec:0x7E:0xA3Sectionmedia_playerUsed for any kind of media device. All subsections are optional, but at least one must be present.media_player:#cannot be emptypower:#optional, but cannot be emptypower_on:<command>#optional, required if 'off' is setpower_off:<command>#optional, required if 'on' is setpower_toggle:<command>#optionalvolume:#optional, but cannot be emptyup:<command>#optional, required if 'down' is setdown:<command>#optional, required if 'up' is setmute_on:<command>#optional, required if 'off' is setmute_off:<command>#optional, required if 'on' is setmute_toggle:<command>#optionalsources:#optional, min length: 1# source names are device dependant. Valid characters: [azAZ09_- ], cannot start with a symbol-source_1:<command>-source_2:<command>sound_modes:#optional, min length: 1# modes names are device dependant. Valid characters: [azAZ09_- ], cannot start with a symbol-mode_1:<command>-mode_2:<command>numbers:#optional, if set ALL numbers are required0:<command>#required1:<command>#required2:<command>#required3:<command>#required4:<command>#required5:<command>#required6:<command>#required7:<command>#required8:<command>#required9:<command>#requiredmedia:#optional, but cannot be emptyplay:<command>#optionalpause:<command>#optionalplay_pause:<command>#optionalstop:<command>#optionalnext_track:<command>#optional, required if 'prev' is setprev_track:<command>#optional, required if 'next' is setfast_forward:<command>#optional, required if 'rewind' is setrewind:<command>#optional, required if 'fast_forward' is setnavigate:#optional, but cannot be emptyup:<command>#optional, required if 'down' is setdown:<command>#optional, required if 'up' is setleft:<command>#optional, required if 'right' is setright:<command>#optional, required if 'left' is setselect:<command>#optionalback:<command>#optional# clear_playlist, shuffle_set, repeat_set,SectionfanUsed for fan device.#TBDSectionair_conditionerUsed for air conditioner device.#TBDSectionlightUsed for light control functions.#TBDSectionswitchUsed for to control simple switching functions.#TBDSectioncustomUsed for arbitrary functions that not fall into any other category.
It is discuraged as it's unstandardized nature cannot be used by higher order components, but can be useful for manual use cases.custom:# function names are completely custom. Valid characters: [azAZ09_- ], cannot start with a symbolfunction1:<command>function2:<command>